//    Copyright (C) 2013  <lugocreation@gmail.com>
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.
package org.jpgolay.me.persistence;

import java.math.BigDecimal;
import java.sql.*;
import java.util.*;
import org.jpgolay.me.agency.Agency;
import org.jpgolay.me.batch.Batch;
import org.jpgolay.me.buy.BuysPiece;
import org.jpgolay.me.customer.Customer;
import org.jpgolay.me.db.Db;
import org.jpgolay.me.details.Details;
import org.jpgolay.me.details.DetailsList;
import org.jpgolay.me.discount.Discount;
import org.jpgolay.me.family.Family;
import org.jpgolay.me.item.Item;
import org.jpgolay.me.number.NextNumber;
import org.jpgolay.me.number.Number;
import org.jpgolay.me.order.OrderRow;
import org.jpgolay.me.payment.Payment;
import org.jpgolay.me.reminder.Reminder;
import org.jpgolay.me.sale.SalesBillPiece;
import org.jpgolay.me.sale.SalesPiece;
import org.jpgolay.me.salesperson.SalesPerson;
import org.jpgolay.me.salesperson.commission.Commission;
import org.jpgolay.me.sending.Sending;
import org.jpgolay.me.stock.log.LogStock;
import org.jpgolay.me.supplier.Supplier;
import org.jpgolay.me.tax.Tax;
import org.jpgolay.me.user.User;
import org.jpgolay.me.util.MEDate;

// Referenced classes of package org.jpgolay.me.persistence:
//            ConnectDB, IfExist, SQLList

public class ObjectCRUD
{

    public ObjectCRUD()
    {
        init();
    }

    public Object create(int type, String arg0)
    {
        return createSQL(type, arg0);
    }

    public Object read(Object pk, int type)
    {
        return readSQL(pk, type);
    }

    public Collection readAll(Object pk, int type)
    {
        return readSQLAll(pk, null, type);
    }

    public Collection readAll(Object pk, Object arg1, int type)
    {
        return readSQLAll(pk, arg1, type);
    }

    public boolean update(Object obj, int type)
    {
        return updateSQL(obj, type);
    }

    public boolean update(Object obj0, Object obj1, int type)
    {
        return updateSQL(obj0, obj1, type);
    }

    public boolean delete(Object pk, String lastUpdate, int type)
    {
        return deleteSQL(pk, lastUpdate, type);
    }

    private void init()
    {
        con = ConnectDB.getConnection();
        date = new MEDate();
    }

    private Object createSQL(int type, String arg0)
    {
        IfExist ie = null;
        try
        {
            switch(type)
            {
            case 22: // '\026'
            {
                pst = con.prepareStatement("INSERT INTO ventes (id,update_time,prefixe) VALUES (?,?,?)");
                NextNumber nn = new NextNumber();
                String idSalesPiece = nn.getSalePieceNumber();
                pst.setString(1, idSalesPiece);
                pst.setString(2, (new MEDate()).getDateTimeDB());
                pst.setString(3, arg0);
                pst.execute();
                return idSalesPiece;
            }

            case 25: // '\031'
            {
                pst = con.prepareStatement("INSERT INTO ventes_factures (id,update_time,prefixe) VALUES (?,?,?)");
                NextNumber nn = new NextNumber();
                String idSalesBillPiece = nn.getBillPieceNumber();
                pst.setString(1, idSalesBillPiece);
                pst.setString(2, (new MEDate()).getDateTimeDB());
                pst.setString(3, arg0);
                pst.execute();
                return idSalesBillPiece;
            }

            case 24: // '\030'
            {
                pst = con.prepareStatement("INSERT INTO achats (id,update_time,prefixe) VALUES (?,?,?)");
                NextNumber nn = new NextNumber();
                String idBuysPiece = nn.getBuyPieceNumber();
                pst.setString(1, idBuysPiece);
                pst.setString(2, (new MEDate()).getDateTimeDB());
                pst.setString(3, arg0);
                pst.execute();
                return idBuysPiece;
            }

            case 27: // '\033'
            {
                pst = con.prepareStatement("INSERT INTO clients (id,update_time) VALUES (?,?)");
                ie = new IfExist();
                if(ie.customerId(arg0))
                {
                    return null;
                } else
                {
                    pst.setString(1, arg0);
                    pst.setString(2, (new MEDate()).getDateTimeDB());
                    pst.execute();
                    return arg0;
                }
            }

            case 9: // '\t'
            {
                pst = con.prepareStatement("INSERT INTO fournisseurs (id,update_time) VALUES (?,?)");
                ie = new IfExist();
                if(ie.supplierId(arg0))
                {
                    return null;
                } else
                {
                    pst.setString(1, arg0);
                    pst.setString(2, (new MEDate()).getDateTimeDB());
                    pst.execute();
                    return arg0;
                }
            }

            case 11: // '\013'
            {
                pst = con.prepareStatement("INSERT INTO articles (ref_code_barre,update_time) VALUES (?,?)");
                ie = new IfExist();
                if(ie.itemId(arg0))
                {
                    return null;
                } else
                {
                    pst.setString(1, arg0);
                    pst.setString(2, (new MEDate()).getDateTimeDB());
                    pst.execute();
                    return arg0;
                }
            }

            case 26: // '\032'
            {
                pst = con.prepareStatement("INSERT INTO reglements_clients (id,update_time) VALUES (?,?)");
                Integer idPayment = getNewId("SELECT MAX(id)+1 FROM reglements_clients");
                pst.setInt(1, idPayment.intValue());
                pst.setString(2, (new MEDate()).getDateTimeDB());
                pst.execute();
                return idPayment;
            }

            case 20: // '\024'
            {
                pst = con.prepareStatement("INSERT INTO reminder (id,update_time) VALUES (?,?)");
                Integer idReminder = getNewId("SELECT MAX(id)+1 FROM reminder");
                pst.setInt(1, idReminder.intValue());
                pst.setString(2, (new MEDate()).getDateTimeDB());
                pst.execute();
                return idReminder;
            }

            case 15: // '\017'
            {
                pst = con.prepareStatement("INSERT INTO commerciaux (id,update_time) VALUES (?,?)");
                Integer idSalesPerson = getNewId("SELECT MAX(id)+1 FROM commerciaux");
                pst.setInt(1, idSalesPerson.intValue());
                pst.setString(2, (new MEDate()).getDateTimeDB());
                pst.execute();
                return idSalesPerson;
            }

            case 21: // '\025'
            {
                pst = con.prepareStatement("INSERT INTO entreprise (id,update_time) VALUES (?,?)");
                Integer idAgency = getNewId("SELECT MAX(id)+1 FROM entreprise");
                pst.setInt(1, idAgency.intValue());
                pst.setString(2, (new MEDate()).getDateTimeDB());
                pst.execute();
                return idAgency;
            }

            case 28: // '\034'
            {
                pst = con.prepareStatement("INSERT INTO contenu (id,update_time) VALUES (?,?)");
                Integer idSalesRows = getNewId("SELECT MAX(id)+1 FROM contenu");
                pst.setInt(1, idSalesRows.intValue());
                pst.setString(2, (new MEDate()).getDateTimeDB());
                pst.execute();
                return idSalesRows;
            }

            case 30: // '\036'
            {
                pst = con.prepareStatement("INSERT INTO contenu_a (id,update_time) VALUES (?,?)");
                Integer idBuysRows = getNewId("SELECT MAX(id)+1 FROM contenu_a");
                pst.setInt(1, idBuysRows.intValue());
                pst.setString(2, (new MEDate()).getDateTimeDB());
                pst.execute();
                return idBuysRows;
            }

            case 18: // '\022'
            {
                pst = con.prepareStatement("INSERT INTO tva (id,update_time) VALUES (?,?)");
                Integer idTax = getNewId("SELECT MAX(id)+1 FROM tva");
                pst.setInt(1, idTax.intValue());
                pst.setString(2, (new MEDate()).getDateTimeDB());
                pst.execute();
                return idTax;
            }

            case 31: // '\037'
            {
                pst = con.prepareStatement("INSERT INTO batch (id,update_time) VALUES (?,?)");
                Integer idBatch = getNewId("SELECT MAX(id)+1 FROM batch");
                pst.setInt(1, idBatch.intValue());
                pst.setString(2, (new MEDate()).getDateTimeDB());
                pst.execute();
                return idBatch;
            }

            case 32: // ' '
            {
                pst = con.prepareStatement("INSERT INTO journal_stock (id,update_time) VALUES (?,?)");
                Integer idLogStock = getNewId("SELECT MAX(id)+1 FROM journal_stock");
                pst.setInt(1, idLogStock.intValue());
                pst.setString(2, (new MEDate()).getDateTimeDB());
                pst.execute();
                return idLogStock;
            }

            case 33: // '!'
            {
                pst = con.prepareStatement("INSERT INTO sending (id,update_time) VALUES (?,?)");
                Integer idSending = getNewId("SELECT MAX(id)+1 FROM sending");
                pst.setInt(1, idSending.intValue());
                pst.setString(2, (new MEDate()).getDateTimeDB());
                pst.execute();
                return idSending;
            }

            case 34: // '"'
            {
                pst = con.prepareStatement("INSERT INTO numero_achat (id) VALUES (?)");
                Integer idBuyNumber = getNewId("SELECT MAX(id)+1 FROM numero_achat");
                pst.setInt(1, idBuyNumber.intValue());
                pst.execute();
                return idBuyNumber;
            }

            case 35: // '#'
            {
                pst = con.prepareStatement("INSERT INTO numero_expedition (id) VALUES (?)");
                Integer idSendingNumber = getNewId("SELECT MAX(id)+1 FROM numero_expedition");
                pst.setInt(1, idSendingNumber.intValue());
                pst.execute();
                return idSendingNumber;
            }

            case 36: // '$'
            {
                pst = con.prepareStatement("INSERT INTO numero_facture (id) VALUES (?)");
                Integer idSalesBillNumber = getNewId("SELECT MAX(id)+1 FROM numero_facture");
                pst.setInt(1, idSalesBillNumber.intValue());
                pst.execute();
                return idSalesBillNumber;
            }

            case 37: // '%'
            {
                pst = con.prepareStatement("INSERT INTO numero_lot (id) VALUES (?)");
                Integer idBatchNumber = getNewId("SELECT MAX(id)+1 FROM numero_lot");
                pst.setInt(1, idBatchNumber.intValue());
                pst.execute();
                return idBatchNumber;
            }

            case 38: // '&'
            {
                pst = con.prepareStatement("INSERT INTO numero_vente (id) VALUES (?)");
                Integer idSalesNumber = getNewId("SELECT MAX(id)+1 FROM numero_vente");
                pst.setInt(1, idSalesNumber.intValue());
                pst.execute();
                return idSalesNumber;
            }

            case 12: // '\f'
            {
                pst = con.prepareStatement("INSERT INTO familles_articles (id,update_time) VALUES (?,?)");
                ie = new IfExist();
                if(ie.itemFamilyId(arg0))
                {
                    return null;
                } else
                {
                    pst.setString(1, arg0);
                    pst.setString(2, (new MEDate()).getDateTimeDB());
                    pst.execute();
                    return arg0;
                }
            }

            case 46: // '.'
            {
                pst = con.prepareStatement("INSERT INTO familles_clients (id,update_time) VALUES (?,?)");
                ie = new IfExist();
                if(ie.customerFamilyId(arg0))
                {
                    return null;
                } else
                {
                    pst.setString(1, arg0);
                    pst.setString(2, (new MEDate()).getDateTimeDB());
                    pst.execute();
                    return arg0;
                }
            }

            case 10: // '\n'
            {
                pst = con.prepareStatement("INSERT INTO familles_fournisseurs (id,update_time) VALUES (?,?)");
                ie = new IfExist();
                if(ie.supplierFamilyId(arg0))
                {
                    return null;
                } else
                {
                    pst.setString(1, arg0);
                    pst.setString(2, (new MEDate()).getDateTimeDB());
                    pst.execute();
                    return arg0;
                }
            }

            case 39: // '\''
            {
                pst = con.prepareStatement("INSERT INTO sales_person_family (id,update_time) VALUES (?,?)");
                ie = new IfExist();
                if(ie.salesPersonFamilyId(arg0))
                {
                    return null;
                } else
                {
                    pst.setString(1, arg0);
                    pst.setString(2, (new MEDate()).getDateTimeDB());
                    pst.execute();
                    return arg0;
                }
            }

            case 40: // '('
            {
                pst = con.prepareStatement("INSERT INTO detail_list (id,update_time) VALUES (?,?)");
                Integer idDetailList = getNewId("SELECT MAX(id)+1 FROM detail_list");
                pst.setInt(1, idDetailList.intValue());
                pst.setString(2, (new MEDate()).getDateTimeDB());
                pst.execute();
                return idDetailList;
            }

            case 41: // ')'
            {
                pst = con.prepareStatement("INSERT INTO detail_articles (id,update_time) VALUES (?,?)");
                Integer idItemDetails = getNewId("SELECT MAX(id)+1 FROM detail_articles");
                pst.setInt(1, idItemDetails.intValue());
                pst.setString(2, (new MEDate()).getDateTimeDB());
                pst.execute();
                return idItemDetails;
            }

            case 42: // '*'
            {
                pst = con.prepareStatement("INSERT INTO detail_clients (id,update_time) VALUES (?,?)");
                Integer idCustomerDetail = getNewId("SELECT MAX(id)+1 FROM detail_clients");
                pst.setInt(1, idCustomerDetail.intValue());
                pst.setString(2, (new MEDate()).getDateTimeDB());
                pst.execute();
                return idCustomerDetail;
            }

            case 44: // ','
            {
                pst = con.prepareStatement("INSERT INTO detail_commerciaux (id,update_time) VALUES (?,?)");
                Integer idSalesPersonDetail = getNewId("SELECT MAX(id)+1 FROM detail_commerciaux");
                pst.setInt(1, idSalesPersonDetail.intValue());
                pst.setString(2, (new MEDate()).getDateTimeDB());
                pst.execute();
                return idSalesPersonDetail;
            }

            case 45: // '-'
            {
                pst = con.prepareStatement("INSERT INTO detail_entreprise (id,update_time) VALUES (?,?)");
                Integer idAgencyDetail = getNewId("SELECT MAX(id)+1 FROM detail_entreprise");
                pst.setInt(1, idAgencyDetail.intValue());
                pst.setString(2, (new MEDate()).getDateTimeDB());
                pst.execute();
                return idAgencyDetail;
            }

            case 43: // '+'
            {
                pst = con.prepareStatement("INSERT INTO detail_fournisseurs (id,update_time) VALUES (?,?)");
                Integer idSupplierDetail = getNewId("SELECT MAX(id)+1 FROM detail_fournisseurs");
                pst.setInt(1, idSupplierDetail.intValue());
                pst.setString(2, (new MEDate()).getDateTimeDB());
                pst.execute();
                return idSupplierDetail;
            }

            case 47: // '/'
            {
                pst = con.prepareStatement("INSERT INTO detail_utilisateurs (id,update_time) VALUES (?,?)");
                Integer idUserDetail = getNewId("SELECT MAX(id)+1 FROM detail_utilisateurs");
                pst.setInt(1, idUserDetail.intValue());
                pst.setString(2, (new MEDate()).getDateTimeDB());
                pst.execute();
                return idUserDetail;
            }

            case 19: // '\023'
            {
                pst = con.prepareStatement("INSERT INTO utilisateurs (id,update_time) VALUES (?,?)");
                ie = new IfExist();
                if(ie.userId(arg0))
                {
                    return null;
                } else
                {
                    pst.setString(1, arg0);
                    pst.setString(2, (new MEDate()).getDateTimeDB());
                    pst.execute();
                    return arg0;
                }
            }

            case 48: // '0'
            {
                pst = con.prepareStatement("INSERT INTO remise_par_client (id,update_time) VALUES (?,?)");
                Integer idItemDiscount = getNewId("SELECT MAX(id)+1 FROM remise_par_client");
                pst.setInt(1, idItemDiscount.intValue());
                pst.setString(2, (new MEDate()).getDateTimeDB());
                pst.execute();
                return idItemDiscount;
            }

            case 49: // '1'
            {
                pst = con.prepareStatement("INSERT INTO remise_famart_par_client (id,update_time) VALUES (?,?)");
                Integer idItemFamilyDiscount = getNewId("SELECT MAX(id)+1 FROM remise_famart_par_client");
                pst.setInt(1, idItemFamilyDiscount.intValue());
                pst.setString(2, (new MEDate()).getDateTimeDB());
                pst.execute();
                return idItemFamilyDiscount;
            }

            case 16: // '\020'
            {
                pst = con.prepareStatement("INSERT INTO comm_par_article (id,update_time) VALUES (?,?)");
                Integer idItemCommission = getNewId("SELECT MAX(id)+1 FROM comm_par_article");
                pst.setInt(1, idItemCommission.intValue());
                pst.setString(2, (new MEDate()).getDateTimeDB());
                pst.execute();
                return idItemCommission;
            }

            case 50: // '2'
            {
                pst = con.prepareStatement("INSERT INTO comm_par_famille (id,update_time) VALUES (?,?)");
                Integer idItemFamilyCommission = getNewId("SELECT MAX(id)+1 FROM comm_par_famille");
                pst.setInt(1, idItemFamilyCommission.intValue());
                pst.setString(2, (new MEDate()).getDateTimeDB());
                pst.execute();
                return idItemFamilyCommission;
            }

            case 51: // '3'
            {
                pst = con.prepareStatement("INSERT INTO db (id,update_time) VALUES (?,?)");
                Integer idDb = getNewId("SELECT MAX(id)+1 FROM db");
                pst.setInt(1, idDb.intValue());
                pst.setString(2, (new MEDate()).getDateTimeDB());
                pst.execute();
                return idDb;
            }

            case 13: // '\r'
            case 14: // '\016'
            case 17: // '\021'
            case 23: // '\027'
            case 29: // '\035'
            default:
            {
                return null;
            }
            }
        }
        catch(SQLException e)
        {
            e.printStackTrace();
        }
        return null;
    }

    private Object readSQL(Object pk, int type)
    {
        try
        {
            switch(type)
            {
            case 22: // '\026'
                pst = con.prepareStatement("SELECT id,prefixe,date,clients_id,commerciaux_id,contenu,net_a_payer,echeance,date_livraison,livre,date_relance,montant_regle,mode_reglement,solde_le,entreprise_id,prepared,total_brut_ht,commentaire,total_taxes,montant_tva1,montant_tva2,montant_tva3,montant_tva4,montant_tva5,no_fact,update_user_id,update_time,total_sous_total,tva_port FROM ventes WHERE id=?");
                pst.setString(1, (String)pk);
                rs = pst.executeQuery();
                if(rs.next())
                {
                    SalesPiece piece = new SalesPiece();
                    piece.setId(rs.getString(1));
                    piece.setPrefix(rs.getString(2));
                    piece.setDate(date.toME(rs.getString(3)));
                    piece.setCustomerId(rs.getString(4));
                    piece.setSalesPersonId(new Integer(rs.getInt(5)));
                    piece.setShippingPrice(rs.getBigDecimal(6));
                    piece.setNetPrice(rs.getBigDecimal(7));
                    piece.setDueDate(date.toME(rs.getString(8)));
                    piece.setDeliveryDate(date.toME(rs.getString(9)));
                    piece.setDeliveryMan(rs.getString(10));
                    piece.setReminderDate(date.toME(rs.getString(11)));
                    piece.setPartPayment(rs.getBigDecimal(12));
                    piece.setMethodeOfPayment(rs.getString(13));
                    piece.setClearDate(date.toME(rs.getString(14)));
                    piece.setCompagnyId(new Integer(rs.getInt(15)));
                    piece.setPrepare(new Integer(rs.getInt(16)));
                    piece.setGrossPrice(rs.getBigDecimal(17));
                    piece.setNotes(rs.getString(18));
                    piece.setTotalTax(rs.getBigDecimal(19));
                    piece.setTax1(rs.getBigDecimal(20));
                    piece.setTax2(rs.getBigDecimal(21));
                    piece.setTax3(rs.getBigDecimal(22));
                    piece.setTax4(rs.getBigDecimal(23));
                    piece.setTax5(rs.getBigDecimal(24));
                    piece.setBillReference(rs.getString(25));
                    piece.setUpdateUserId(rs.getString(26));
                    piece.setUpdateTime(rs.getString(27));
                    piece.setSendingId(rs.getBigDecimal(28));
                    piece.setShippingTax(rs.getBigDecimal(29));
                    return piece;
                } else
                {
                    return null;
                }

            case 25: // '\031'
                pst = con.prepareStatement("SELECT id,prefixe,date,clients_id,commerciaux_id,contenu,net_a_payer,echeance,date_relance,montant_regle,mode_reglement,solde_le,entreprise_id,locking,total_brut_ht,commentaire,total_taxes,montant_tva1,montant_tva2,montant_tva3,montant_tva4,montant_tva5,total_sous_total,ventes,update_user_id,update_time,tva_port FROM ventes_factures WHERE id=?");
                pst.setString(1, (String)pk);
                rs = pst.executeQuery();
                if(rs.next())
                {
                    SalesBillPiece piece = new SalesBillPiece();
                    piece.setId(rs.getString(1));
                    piece.setPrefix(rs.getString(2));
                    piece.setDate(date.toME(rs.getString(3)));
                    piece.setCustomerId(rs.getString(4));
                    piece.setSalesPersonId(new Integer(rs.getInt(5)));
                    piece.setShippingPrice(rs.getBigDecimal(6));
                    piece.setNetPrice(rs.getBigDecimal(7));
                    piece.setDueDate(date.toME(rs.getString(8)));
                    piece.setReminderDate(date.toME(rs.getString(9)));
                    piece.setPartPayment(rs.getBigDecimal(10));
                    piece.setMethodeOfPayment(rs.getString(11));
                    piece.setClearDate(date.toME(rs.getString(12)));
                    piece.setCompagnyId(new Integer(rs.getInt(13)));
                    piece.setLocking(new Integer(rs.getInt(14)));
                    piece.setGrossPrice(rs.getBigDecimal(15));
                    piece.setNotes(rs.getString(16));
                    piece.setTotalTax(rs.getBigDecimal(17));
                    piece.setTax1(rs.getBigDecimal(18));
                    piece.setTax2(rs.getBigDecimal(19));
                    piece.setTax3(rs.getBigDecimal(20));
                    piece.setTax4(rs.getBigDecimal(21));
                    piece.setTax5(rs.getBigDecimal(22));
                    piece.setSubTotal(rs.getBigDecimal(23));
                    piece.setBillReference(rs.getString(24));
                    piece.setUpdateUserId(rs.getString(25));
                    piece.setUpdateTime(rs.getString(26));
                    piece.setShippingTax(rs.getBigDecimal(27));
                    return piece;
                } else
                {
                    return null;
                }

            case 24: // '\030'
                pst = con.prepareStatement("SELECT id,date,entreprise_id,locking,fournisseurs_id,commerciaux_id,no_fact,prefixe,contenu,net_a_payer,total_brut_ht,total_taxes,montant_tva1,montant_tva2,montant_tva3,montant_tva4,montant_tva5,montant_regle,mode_reglement,recu_le,solde_le,commentaire,update_user_id,update_time,tva_port FROM achats WHERE id=?");
                pst.setString(1, (String)pk);
                rs = pst.executeQuery();
                if(rs.next())
                {
                    BuysPiece piece = new BuysPiece();
                    piece.setId(rs.getString(1));
                    piece.setDate(date.toME(rs.getString(2)));
                    piece.setCompagnyId(new Integer(rs.getInt(3)));
                    piece.setLocking(new Integer(rs.getInt(4)));
                    piece.setSupplierId(rs.getString(5));
                    piece.setSalesPersonId(new Integer(rs.getInt(6)));
                    piece.setBillReference(rs.getString(7));
                    piece.setPrefix(rs.getString(8));
                    piece.setShippingPrice(rs.getBigDecimal(9));
                    piece.setNetPrice(rs.getBigDecimal(10));
                    piece.setGrossPrice(rs.getBigDecimal(11));
                    piece.setTotalTax(rs.getBigDecimal(12));
                    piece.setTax1(rs.getBigDecimal(13));
                    piece.setTax2(rs.getBigDecimal(14));
                    piece.setTax3(rs.getBigDecimal(15));
                    piece.setTax4(rs.getBigDecimal(16));
                    piece.setTax5(rs.getBigDecimal(17));
                    piece.setPartPayment(rs.getBigDecimal(18));
                    piece.setMethodeOfPayment(rs.getString(19));
                    piece.setDeliveryDate(date.toME(rs.getString(20)));
                    piece.setClearDate(date.toME(rs.getString(21)));
                    piece.setNotes(rs.getString(22));
                    piece.setUpdateUserId(rs.getString(23));
                    piece.setUpdateTime(rs.getString(24));
                    piece.setShippingTax(rs.getBigDecimal(25));
                    return piece;
                } else
                {
                    return null;
                }

            case 27: // '\033'
                pst = con.prepareStatement("SELECT id,id_gln,raison_sociale,adresse_fact,cp_fact,ville_fact,pays_fact,adresse_livr,cp_livr,ville_livr,pays_livr,mode_reglement,civilite,no_compte,commerciaux_id,contact,fonction_contact,telephone,portable,fax,email,site_web,familles_clients_id,remise,remise_excep,echeance_paiement,total_encaisse,cota_fidelite,commentaire,adresse2_fact,adresse2_livr,banque,update_user_id,update_time,photo1,photo2 FROM clients WHERE id=?");
                pst.setString(1, (String)pk);
                rs = pst.executeQuery();
                if(rs.next())
                {
                    Customer customer = new Customer();
                    customer.setId(rs.getString(1));
                    customer.setIdGLN(rs.getString(2));
                    customer.setRaisonSociale(rs.getString(3));
                    customer.setAdresseFactUn(rs.getString(4));
                    customer.setCpFact(rs.getString(5));
                    customer.setVilleFact(rs.getString(6));
                    customer.setPaysFact(rs.getString(7));
                    customer.setAdresseLivrUn(rs.getString(8));
                    customer.setCpLivr(rs.getString(9));
                    customer.setVilleLivr(rs.getString(10));
                    customer.setPaysLivr(rs.getString(11));
                    customer.setModeReglement(rs.getString(12));
                    customer.setCivilite(rs.getString(13));
                    customer.setNumeroCompte(rs.getString(14));
                    customer.setCommerciauxId(new Integer(rs.getInt(15)));
                    customer.setNomPrenomContact(rs.getString(16));
                    customer.setFonctionContact(rs.getString(17));
                    customer.setTelephone(rs.getString(18));
                    customer.setPortable(rs.getString(19));
                    customer.setFax(rs.getString(20));
                    customer.setEmail(rs.getString(21));
                    customer.setSiteWeb(rs.getString(22));
                    customer.setFamilleClientId(rs.getString(23));
                    customer.setRemise(rs.getBigDecimal(24));
                    customer.setRemiseFidelite(rs.getBigDecimal(25));
                    customer.setEcheancePaiement(rs.getBigDecimal(26));
                    customer.setTotalEncaisser(rs.getBigDecimal(27));
                    customer.setCotaFidelite(rs.getBigDecimal(28));
                    customer.setCommentaire(rs.getString(29));
                    customer.setAdresseFactDeux(rs.getString(30));
                    customer.setAdresseLivrDeux(rs.getString(31));
                    customer.setBanque(rs.getString(32));
                    customer.setUserId(rs.getString(33));
                    customer.setUpdateLastTime(rs.getString(34));
                    customer.setPhoto1(rs.getBytes(35));
                    customer.setPhoto2(rs.getBytes(36));
                    return customer;
                } else
                {
                    return null;
                }

            case 9: // '\t'
                pst = con.prepareStatement("SELECT id,raison_sociale,adresse_com,cp_com,ville_com,pays_com,adresse_enlev,cp_enlev,ville_enlev,pays_enlev,civilite,no_compte,contact,fonction_contact,telephone,portable,fax,email,site_web,familles_fournisseurs_id,commentaire,adresse2_com,adresse2_enlev,update_user_id,update_time,gln,photo1,photo2 FROM fournisseurs WHERE id=?");
                pst.setString(1, (String)pk);
                rs = pst.executeQuery();
                if(rs.next())
                {
                    Supplier supplier = new Supplier();
                    supplier.setId(rs.getString(1));
                    supplier.setRaisonSociale(rs.getString(2));
                    supplier.setAdresseComUn(rs.getString(3));
                    supplier.setCpCom(rs.getString(4));
                    supplier.setVilleCom(rs.getString(5));
                    supplier.setPaysCom(rs.getString(6));
                    supplier.setAdresseEnlevUn(rs.getString(7));
                    supplier.setCpEnlev(rs.getString(8));
                    supplier.setVilleEnlev(rs.getString(9));
                    supplier.setPaysEnlev(rs.getString(10));
                    supplier.setCivilite(rs.getString(11));
                    supplier.setNumeroCompte(rs.getString(12));
                    supplier.setNomPrenomContact(rs.getString(13));
                    supplier.setFonctionContact(rs.getString(14));
                    supplier.setTelephone(rs.getString(15));
                    supplier.setPortable(rs.getString(16));
                    supplier.setFax(rs.getString(17));
                    supplier.setEmail(rs.getString(18));
                    supplier.setSiteWeb(rs.getString(19));
                    supplier.setFamilleFournisseurId(rs.getString(20));
                    supplier.setCommentaire(rs.getString(21));
                    supplier.setAdresseComDeux(rs.getString(22));
                    supplier.setAdresseEnlevDeux(rs.getString(23));
                    supplier.setUserId(rs.getString(24));
                    supplier.setUpdateLastTime(rs.getString(25));
                    supplier.setGln(rs.getString(26));
                    supplier.setPhoto1(rs.getBytes(27));
                    supplier.setPhoto2(rs.getBytes(28));
                    return supplier;
                } else
                {
                    return null;
                }

            case 11: // '\013'
                pst = con.prepareStatement("SELECT designation,familles_articles_id,ref_code_barre,price_list2,price_list3,price_list4,tva_id,fournisseurs_id,promotion,emplacement,web,prix_revient,price_list1,commentaire,alerte,unite_vente,update_user_id,update_time,date2,date3,date4,date,detail_revient,free1,free2,prix_achat_pondere,packaging,gtin,photo1,photo2,photo3,photo4,photo5,photo6,photo7,photo8,photo9,photo10,photos_valid,description FROM articles WHERE ref_code_barre=?");
                pst.setString(1, (String)pk);
                rs = pst.executeQuery();
                if(rs.next())
                {
                    Item item = new Item();
                    item.setDesignation(rs.getString(1));
                    item.setFamillesArticlesId(rs.getString(2));
                    item.setId(rs.getString(3));
                    item.setPriceList2(rs.getBigDecimal(4));
                    item.setPriceList3(rs.getBigDecimal(5));
                    item.setPriceList4(rs.getBigDecimal(6));
                    item.setTvaId(new Integer(rs.getInt(7)));
                    item.setFournisseurId(rs.getString(8));
                    item.setPromotion(rs.getBigDecimal(9));
                    item.setEmplacement(rs.getString(10));
                    item.setWeb(rs.getString(11));
                    item.setPrixRevient(rs.getBigDecimal(12));
                    item.setPriceList1(rs.getBigDecimal(13));
                    item.setCommentaire(rs.getString(14));
                    item.setAlerte(rs.getBigDecimal(15));
                    item.setUniteVente(rs.getString(16));
                    item.setUserId(rs.getString(17));
                    item.setUpdateLastTime(rs.getString(18));
                    item.setDate2(date.toME(rs.getString(19)));
                    item.setDate3(date.toME(rs.getString(20)));
                    item.setDate4(date.toME(rs.getString(21)));
                    item.setDate(date.toME(rs.getString(22)));
                    item.setDetailRevient(rs.getString(23));
                    item.setFree1(rs.getString(24));
                    item.setFree2(rs.getString(25));
                    item.setPrixAchatPondere(rs.getBigDecimal(26));
                    item.setPackaging(new Integer(rs.getInt(27)));
                    item.setGtin(rs.getString(28));
                    item.setPhoto1(rs.getBytes(29));
                    item.setPhoto2(rs.getBytes(30));
                    item.setPhoto3(rs.getBytes(31));
                    item.setPhoto4(rs.getBytes(32));
                    item.setPhoto5(rs.getBytes(33));
                    item.setPhoto6(rs.getBytes(34));
                    item.setPhoto7(rs.getBytes(35));
                    item.setPhoto8(rs.getBytes(36));
                    item.setPhoto9(rs.getBytes(37));
                    item.setPhoto10(rs.getBytes(38));
                    item.setPhotosValid(rs.getString(39));
                    item.setDescription(rs.getString(40));
                    return item;
                } else
                {
                    return null;
                }

            case 26: // '\032'
                pst = con.prepareStatement("SELECT id,prefix,piece_id,montant,mode,date,pointage,numero,update_user_id,update_time FROM reglements_clients WHERE id=?");
                Integer idPayment = (Integer)pk;
                pst.setInt(1, idPayment.intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    Payment payment = new Payment();
                    payment.setId(new Integer(rs.getInt(1)));
                    payment.setPrefix(rs.getString(2));
                    payment.setPieceId(rs.getString(3));
                    payment.setMontant(rs.getBigDecimal(4));
                    payment.setMode(rs.getString(5));
                    payment.setDate(date.toME(rs.getString(6)));
                    payment.setPointage(rs.getString(7));
                    payment.setNumero(rs.getString(8));
                    payment.setUserId(rs.getString(9));
                    payment.setUpdateLastTime(rs.getString(10));
                    return payment;
                } else
                {
                    return null;
                }

            case 20: // '\024'
                pst = con.prepareStatement("SELECT id,piece_id,date,status,notes,update_user_id,update_time FROM reminder WHERE id=?");
                Integer idReminder = (Integer)pk;
                pst.setInt(1, idReminder.intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    Reminder reminder = new Reminder();
                    reminder.setId(new Integer(rs.getInt(1)));
                    reminder.setPieceId(rs.getString(2));
                    reminder.setDate(date.toME(rs.getString(3)));
                    reminder.setStatus(new Integer(rs.getInt(4)));
                    reminder.setNotes(rs.getString(5));
                    reminder.setUserId(rs.getString(6));
                    reminder.setUpdateLastTime(rs.getString(7));
                    return reminder;
                } else
                {
                    return null;
                }

            case 15: // '\017'
                pst = con.prepareStatement("SELECT id,nom,prenom,secteur,telephone,portable,fax,email,niveau,taux_vente,taux_total_vente,resultat,resultat_date,objectif,objectif_date,commentaire,update_user_id,update_time,sales_person_family_id,addr_ln1,addr_ln2,zip,city,country FROM commerciaux WHERE id=?");
                Integer idSalesPerson = (Integer)pk;
                pst.setInt(1, idSalesPerson.intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    SalesPerson salesPerson = new SalesPerson();
                    salesPerson.setId(new Integer(rs.getInt(1)));
                    salesPerson.setNom(rs.getString(2));
                    salesPerson.setPrenom(rs.getString(3));
                    salesPerson.setSecteur(rs.getString(4));
                    salesPerson.setTelephone(rs.getString(5));
                    salesPerson.setPortable(rs.getString(6));
                    salesPerson.setFax(rs.getString(7));
                    salesPerson.setEmail(rs.getString(8));
                    salesPerson.setNiveau(rs.getString(9));
                    salesPerson.setTauxVente(rs.getBigDecimal(10));
                    salesPerson.setTauxTotalVente(rs.getBigDecimal(11));
                    salesPerson.setResultat(rs.getBigDecimal(12));
                    salesPerson.setResultatDate(date.toME(rs.getString(13)));
                    salesPerson.setObjectif(rs.getBigDecimal(14));
                    salesPerson.setObjectifDate(date.toME(rs.getString(15)));
                    salesPerson.setCommentaire(rs.getString(16));
                    salesPerson.setUserId(rs.getString(17));
                    salesPerson.setUpdateLastTime(rs.getString(18));
                    salesPerson.setSalesPersonFamily(rs.getString(19));
                    salesPerson.setAddrLn1(rs.getString(20));
                    salesPerson.setAddrLn2(rs.getString(21));
                    salesPerson.setZip(rs.getString(22));
                    salesPerson.setCity(rs.getString(23));
                    salesPerson.setCountry(rs.getString(24));
                    return salesPerson;
                } else
                {
                    return null;
                }

            case 21: // '\025'
                pst = con.prepareStatement("SELECT id,raison_sociale,civilite,adresse,cp,ville,pays,telephone,fax,email,siret,naf,site_web,adresse2,telephone_deux,telephone_trois,fax_deux,fax_trois,update_user_id,update_time,gln,photo1,photo2,notes FROM entreprise WHERE id=?");
                Integer idAgency = (Integer)pk;
                pst.setInt(1, idAgency.intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    Agency agency = new Agency();
                    agency.setId(new Integer(rs.getInt(1)));
                    agency.setRaisonSociale(rs.getString(2));
                    agency.setCivilite(rs.getString(3));
                    agency.setAdresseUn(rs.getString(4));
                    agency.setCp(rs.getString(5));
                    agency.setVille(rs.getString(6));
                    agency.setPays(rs.getString(7));
                    agency.setTelephoneUn(rs.getString(8));
                    agency.setFaxUn(rs.getString(9));
                    agency.setEmail(rs.getString(10));
                    agency.setSiret(rs.getString(11));
                    agency.setNaf(rs.getString(12));
                    agency.setSiteWeb(rs.getString(13));
                    agency.setAdresseDeux(rs.getString(14));
                    agency.setTelephoneDeux(rs.getString(15));
                    agency.setTelephoneTrois(rs.getString(16));
                    agency.setFaxDeux(rs.getString(17));
                    agency.setFaxTrois(rs.getString(18));
                    agency.setUserId(rs.getString(19));
                    agency.setUpdateLastTime(rs.getString(20));
                    agency.setGln(rs.getString(21));
                    agency.setPhoto1(rs.getBytes(22));
                    agency.setPhoto2(rs.getBytes(23));
                    agency.setNotes(rs.getString(24));
                    return agency;
                } else
                {
                    return null;
                }

            case 28: // '\034'
                pst = con.prepareStatement("SELECT id,line,status,facture_id,vente_id,article_id,designation,tva_id,lot_id,reliquat_id,quantite,prix_vente,prix_unitaire,total_ht,remise,update_user_id,update_time,batch_id FROM contenu WHERE id=?");
                Integer idSalesRows = (Integer)pk;
                pst.setInt(1, idSalesRows.intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    OrderRow row = new OrderRow();
                    row.setId(new Integer(rs.getInt(1)));
                    row.setLine(new Integer(rs.getInt(2)));
                    row.setStatus(rs.getBigDecimal(3));
                    row.setFactureId(rs.getString(4));
                    row.setVenteId(rs.getString(5));
                    row.setArticleId(rs.getString(6));
                    row.setDesignation(rs.getString(7));
                    row.setTvaId(new Integer(rs.getInt(8)));
                    row.setLotId(rs.getString(9));
                    row.setReliquatId(new Integer(rs.getInt(10)));
                    row.setQuantite(rs.getBigDecimal(11));
                    row.setPrixVente(rs.getBigDecimal(12));
                    row.setPrixUnitaire(rs.getBigDecimal(13));
                    row.setTotalHt(rs.getBigDecimal(14));
                    row.setRemise(rs.getBigDecimal(15));
                    row.setUserId(rs.getString(16));
                    row.setUpdateLastTime(rs.getString(17));
                    row.setBatchId(new Integer(rs.getInt(18)));
                    return row;
                } else
                {
                    return null;
                }

            case 30: // '\036'
                pst = con.prepareStatement("SELECT id,line,status,facture_id,vente_id,article_id,designation,tva_id,lot_id,reliquat_id,quantite,prix_vente,prix_unitaire,total_ht,remise,update_user_id,update_time,batch_id FROM contenu_a WHERE id=?");
                Integer idBuysRows = (Integer)pk;
                pst.setInt(1, idBuysRows.intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    OrderRow row = new OrderRow();
                    row.setId(new Integer(rs.getInt(1)));
                    row.setLine(new Integer(rs.getInt(2)));
                    row.setStatus(rs.getBigDecimal(3));
                    row.setFactureId(rs.getString(4));
                    row.setVenteId(rs.getString(5));
                    row.setArticleId(rs.getString(6));
                    row.setDesignation(rs.getString(7));
                    row.setTvaId(new Integer(rs.getInt(8)));
                    row.setLotId(rs.getString(9));
                    row.setReliquatId(new Integer(rs.getInt(10)));
                    row.setQuantite(rs.getBigDecimal(11));
                    row.setPrixVente(rs.getBigDecimal(12));
                    row.setPrixUnitaire(rs.getBigDecimal(13));
                    row.setTotalHt(rs.getBigDecimal(14));
                    row.setRemise(rs.getBigDecimal(15));
                    row.setUserId(rs.getString(16));
                    row.setUpdateLastTime(rs.getString(17));
                    row.setBatchId(new Integer(rs.getInt(18)));
                    return row;
                } else
                {
                    return null;
                }

            case 18: // '\022'
                pst = con.prepareStatement("SELECT id,taux,update_user_id,update_time FROM tva WHERE id=?");
                Integer idTax = (Integer)pk;
                pst.setInt(1, idTax.intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    Tax tax = new Tax();
                    tax.setId(new Integer(rs.getInt(1)));
                    tax.setTaux(rs.getBigDecimal(2));
                    tax.setUserId(rs.getString(3));
                    tax.setUpdateLastTime(rs.getString(4));
                    return tax;
                } else
                {
                    return null;
                }

            case 31: // '\037'
                pst = con.prepareStatement("SELECT id,buy_id,sscc,trucking_company,pallet_gtin,box_gtin,item_gtin,item_id,item_batch,delivery_form,supplier_gln,supplier_id,agency_id,input_stock_date,inventory_date,dlc,dluo,input_stock_quantity,stock_quantity,delta_inventory,packaging,unit,batch_price,status,notes,update_user_id,update_time FROM batch WHERE id=?");
                Integer idBatch = (Integer)pk;
                pst.setInt(1, idBatch.intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    Batch batch = new Batch();
                    batch.setId(new Integer(rs.getInt(1)));
                    batch.setBuyId(rs.getString(2));
                    batch.setSscc(rs.getString(3));
                    batch.setTruckingCompagny(rs.getString(4));
                    batch.setPalletGTIN(rs.getString(5));
                    batch.setBoxGTIN(rs.getString(6));
                    batch.setItemGTIN(rs.getString(7));
                    batch.setItemId(rs.getString(8));
                    batch.setItemBatch(rs.getString(9));
                    batch.setDeliveryForm(rs.getString(10));
                    batch.setSupplierGLN(rs.getString(11));
                    batch.setSupplierId(rs.getString(12));
                    batch.setAgencyId(new Integer(rs.getInt(13)));
                    batch.setInputStockDate(date.toME(rs.getString(14)));
                    batch.setInventoryDate(date.toME(rs.getString(15)));
                    batch.setDateDLC(date.toME(rs.getString(16)));
                    batch.setDateDLUO(date.toME(rs.getString(17)));
                    batch.setInputStockQuantity(rs.getBigDecimal(18));
                    batch.setStockQuantity(rs.getBigDecimal(19));
                    batch.setDeltaInventory(rs.getBigDecimal(20));
                    batch.setPackaging(rs.getBigDecimal(21));
                    batch.setUnit(rs.getString(22));
                    batch.setBatchPrice(rs.getBigDecimal(23));
                    batch.setStatus(new Integer(rs.getInt(24)));
                    batch.setNotes(rs.getString(25));
                    batch.setUserId(rs.getString(26));
                    batch.setUpdateLastTime(rs.getString(27));
                    return batch;
                } else
                {
                    return null;
                }

            case 32: // ' '
                pst = con.prepareStatement("SELECT id,operation,de,vers,quantite,date,update_user_id,update_time,articles_id,no_lot,commentaire FROM journal_stock WHERE id=?");
                Integer idLogStock = (Integer)pk;
                pst.setInt(1, idLogStock.intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    LogStock logStock = new LogStock();
                    logStock.setId(new Integer(rs.getInt(1)));
                    logStock.setOperation(rs.getString(2));
                    logStock.setDe(rs.getString(3));
                    logStock.setVers(rs.getString(4));
                    logStock.setQuantity(rs.getBigDecimal(5));
                    logStock.setDate(date.toME(rs.getString(6)));
                    logStock.setUserId(rs.getString(7));
                    logStock.setUpdateLastTime(rs.getString(8));
                    logStock.setItemId(rs.getString(9));
                    logStock.setBatchId(new Integer(rs.getInt(10)));
                    logStock.setNotes(rs.getString(11));
                    return logStock;
                } else
                {
                    return null;
                }

            case 33: // '!'
                pst = con.prepareStatement("SELECT id,order_id,sscc,trucking_company,pallet_gtin,box_gtin,delivery_form,supplier_gln,supplier_id,agency_id,sending_date,preparation_date,delivery_anticipated_date,delivery_date,weight,parcel_quantity,packaging,unit,insurance_value,insurance_company,status,notes,update_user_id,update_time FROM sending WHERE id=?");
                Integer idSending = (Integer)pk;
                pst.setInt(1, idSending.intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    Sending sending = new Sending();
                    sending.setId(new Integer(rs.getInt(1)));
                    sending.setOrderId(rs.getString(2));
                    sending.setSscc(rs.getString(3));
                    sending.setTruckingCompagny(rs.getString(4));
                    sending.setPalletGTIN(rs.getString(5));
                    sending.setBoxGTIN(rs.getString(6));
                    sending.setDeliveryForm(rs.getString(7));
                    sending.setCustomerGLN(rs.getString(8));
                    sending.setCustomerId(rs.getString(9));
                    sending.setAgencyId(new Integer(rs.getInt(10)));
                    sending.setSendingDate(date.toME(rs.getString(11)));
                    sending.setPreparationDate(date.toME(rs.getString(12)));
                    sending.setDeliveryAnticipatedDate(date.toME(rs.getString(13)));
                    sending.setDeliveryDate(date.toME(rs.getString(14)));
                    sending.setWeight(rs.getBigDecimal(15));
                    sending.setParcelQuantity(rs.getBigDecimal(16));
                    sending.setPackaging(rs.getBigDecimal(17));
                    sending.setUnit(rs.getString(18));
                    sending.setInsuranceValue(rs.getBigDecimal(19));
                    sending.setInsuranceCompany(rs.getString(20));
                    sending.setStatus(new Integer(rs.getInt(21)));
                    sending.setNotes(rs.getString(22));
                    sending.setUserId(rs.getString(23));
                    sending.setUpdateLastTime(rs.getString(24));
                    return sending;
                } else
                {
                    return null;
                }

            case 34: // '"'
                pst = con.prepareStatement("SELECT id,time FROM numero_achat WHERE id=?");
                Integer idBuyNumber = (Integer)pk;
                pst.setInt(1, idBuyNumber.intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    Number number = new Number();
                    number.setId(new Integer(rs.getInt(1)));
                    number.setTime(rs.getString(2));
                    return number;
                } else
                {
                    return null;
                }

            case 35: // '#'
                pst = con.prepareStatement("SELECT id,time FROM numero_expedition WHERE id=?");
                Integer idSendingNumber = (Integer)pk;
                pst.setInt(1, idSendingNumber.intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    Number number = new Number();
                    number.setId(new Integer(rs.getInt(1)));
                    number.setTime(rs.getString(2));
                    return number;
                } else
                {
                    return null;
                }

            case 36: // '$'
                pst = con.prepareStatement("SELECT id,time FROM numero_facture WHERE id=?");
                Integer idSalesBillNumber = (Integer)pk;
                pst.setInt(1, idSalesBillNumber.intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    Number number = new Number();
                    number.setId(new Integer(rs.getInt(1)));
                    number.setTime(rs.getString(2));
                    return number;
                } else
                {
                    return null;
                }

            case 37: // '%'
                pst = con.prepareStatement("SELECT id,time FROM numero_lot WHERE id=?");
                Integer idBatchNumber = (Integer)pk;
                pst.setInt(1, idBatchNumber.intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    Number number = new Number();
                    number.setId(new Integer(rs.getInt(1)));
                    number.setTime(rs.getString(2));
                    return number;
                } else
                {
                    return null;
                }

            case 38: // '&'
                pst = con.prepareStatement("SELECT id,time FROM numero_vente WHERE id=?");
                Integer idSalesNumber = (Integer)pk;
                pst.setInt(1, idSalesNumber.intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    Number number = new Number();
                    number.setId(new Integer(rs.getInt(1)));
                    number.setTime(rs.getString(2));
                    return number;
                } else
                {
                    return null;
                }

            case 12: // '\f'
                pst = con.prepareStatement("SELECT id,designation,coefficient,update_user_id,update_time FROM familles_articles WHERE id=?");
                String idItemFamily = (String)pk;
                pst.setString(1, idItemFamily);
                rs = pst.executeQuery();
                if(rs.next())
                {
                    Family family = new Family();
                    family.setId(rs.getString(1));
                    family.setDesignation(rs.getString(2));
                    family.setCoefficient(rs.getBigDecimal(3));
                    family.setUpdateUserId(rs.getString(4));
                    family.setUpdateTime(rs.getString(5));
                    return family;
                } else
                {
                    return null;
                }

            case 46: // '.'
                pst = con.prepareStatement("SELECT id,designation,coefficient,update_user_id,update_time FROM familles_clients WHERE id=?");
                String idCustomerFamily = (String)pk;
                pst.setString(1, idCustomerFamily);
                rs = pst.executeQuery();
                if(rs.next())
                {
                    Family family = new Family();
                    family.setId(rs.getString(1));
                    family.setDesignation(rs.getString(2));
                    family.setCoefficient(rs.getBigDecimal(3));
                    family.setUpdateUserId(rs.getString(4));
                    family.setUpdateTime(rs.getString(5));
                    return family;
                } else
                {
                    return null;
                }

            case 10: // '\n'
                pst = con.prepareStatement("SELECT id,designation,coefficient,update_user_id,update_time FROM familles_fournisseurs WHERE id=?");
                String idSupplierFamily = (String)pk;
                pst.setString(1, idSupplierFamily);
                rs = pst.executeQuery();
                if(rs.next())
                {
                    Family family = new Family();
                    family.setId(rs.getString(1));
                    family.setDesignation(rs.getString(2));
                    family.setCoefficient(rs.getBigDecimal(3));
                    family.setUpdateUserId(rs.getString(4));
                    family.setUpdateTime(rs.getString(5));
                    return family;
                } else
                {
                    return null;
                }

            case 39: // '\''
                pst = con.prepareStatement("SELECT id,designation,coefficient,update_user_id,update_time FROM sales_person_family WHERE id=?");
                String idSalesPersonFamily = (String)pk;
                pst.setString(1, idSalesPersonFamily);
                rs = pst.executeQuery();
                if(rs.next())
                {
                    Family family = new Family();
                    family.setId(rs.getString(1));
                    family.setDesignation(rs.getString(2));
                    family.setCoefficient(rs.getBigDecimal(3));
                    family.setUpdateUserId(rs.getString(4));
                    family.setUpdateTime(rs.getString(5));
                    return family;
                } else
                {
                    return null;
                }

            case 40: // '('
                pst = con.prepareStatement("SELECT id,name,category,update_user_id,update_time FROM detail_list WHERE id=?");
                Integer idDetailsList = (Integer)pk;
                pst.setInt(1, idDetailsList.intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    DetailsList detailsList = new DetailsList();
                    detailsList.setId(new Integer(rs.getInt(1)));
                    detailsList.setName(rs.getString(2));
                    detailsList.setCategory(rs.getString(3));
                    detailsList.setUpdateUserId(rs.getString(4));
                    detailsList.setUpdateTime(rs.getString(5));
                    return detailsList;
                } else
                {
                    return null;
                }

            case 41: // ')'
                pst = con.prepareStatement("SELECT id,detail_list_id,value,notes,image,parent_id,update_user_id,update_time FROM detail_articles WHERE id=?");
                Integer idItemDetails = (Integer)pk;
                pst.setInt(1, idItemDetails.intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    Details details = new Details();
                    details.setId(new Integer(rs.getInt(1)));
                    details.setDetailListId(new Integer(rs.getInt(2)));
                    details.setValue(rs.getString(3));
                    details.setNotes(rs.getString(4));
                    details.setImage(rs.getBytes(5));
                    details.setParentId(rs.getString(6));
                    details.setUpdateUserId(rs.getString(7));
                    details.setUpdateTime(rs.getString(8));
                    return details;
                } else
                {
                    return null;
                }

            case 42: // '*'
                pst = con.prepareStatement("SELECT id,detail_list_id,value,notes,image,parent_id,update_user_id,update_time FROM detail_clients WHERE id=?");
                Integer idCustomerDetails = (Integer)pk;
                pst.setInt(1, idCustomerDetails.intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    Details details = new Details();
                    details.setId(new Integer(rs.getInt(1)));
                    details.setDetailListId(new Integer(rs.getInt(2)));
                    details.setValue(rs.getString(3));
                    details.setNotes(rs.getString(4));
                    details.setImage(rs.getBytes(5));
                    details.setParentId(rs.getString(6));
                    details.setUpdateUserId(rs.getString(7));
                    details.setUpdateTime(rs.getString(8));
                    return details;
                } else
                {
                    return null;
                }

            case 44: // ','
                pst = con.prepareStatement("SELECT id,detail_list_id,value,notes,image,parent_id,update_user_id,update_time FROM detail_commerciaux WHERE id=?");
                Integer idSalesPersonDetails = (Integer)pk;
                pst.setInt(1, idSalesPersonDetails.intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    Details details = new Details();
                    details.setId(new Integer(rs.getInt(1)));
                    details.setDetailListId(new Integer(rs.getInt(2)));
                    details.setValue(rs.getString(3));
                    details.setNotes(rs.getString(4));
                    details.setImage(rs.getBytes(5));
                    details.setParentId(new Integer(rs.getInt(6)));
                    details.setUpdateUserId(rs.getString(7));
                    details.setUpdateTime(rs.getString(8));
                    return details;
                } else
                {
                    return null;
                }

            case 45: // '-'
                pst = con.prepareStatement("SELECT id,detail_list_id,value,notes,image,parent_id,update_user_id,update_time FROM detail_entreprise WHERE id=?");
                Integer idAgencyDetails = (Integer)pk;
                pst.setInt(1, idAgencyDetails.intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    Details details = new Details();
                    details.setId(new Integer(rs.getInt(1)));
                    details.setDetailListId(new Integer(rs.getInt(2)));
                    details.setValue(rs.getString(3));
                    details.setNotes(rs.getString(4));
                    details.setImage(rs.getBytes(5));
                    details.setParentId(new Integer(rs.getInt(6)));
                    details.setUpdateUserId(rs.getString(7));
                    details.setUpdateTime(rs.getString(8));
                    return details;
                } else
                {
                    return null;
                }

            case 43: // '+'
                pst = con.prepareStatement("SELECT id,detail_list_id,value,notes,image,parent_id,update_user_id,update_time FROM detail_fournisseurs WHERE id=?");
                Integer idSupplierDetails = (Integer)pk;
                pst.setInt(1, idSupplierDetails.intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    Details details = new Details();
                    details.setId(new Integer(rs.getInt(1)));
                    details.setDetailListId(new Integer(rs.getInt(2)));
                    details.setValue(rs.getString(3));
                    details.setNotes(rs.getString(4));
                    details.setImage(rs.getBytes(5));
                    details.setParentId(rs.getString(6));
                    details.setUpdateUserId(rs.getString(7));
                    details.setUpdateTime(rs.getString(8));
                    return details;
                } else
                {
                    return null;
                }

            case 47: // '/'
                pst = con.prepareStatement("SELECT id,detail_list_id,value,notes,image,parent_id,update_user_id,update_time FROM detail_utilisateurs WHERE id=?");
                Integer idUserDetails = (Integer)pk;
                pst.setInt(1, idUserDetails.intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    Details details = new Details();
                    details.setId(new Integer(rs.getInt(1)));
                    details.setDetailListId(new Integer(rs.getInt(2)));
                    details.setValue(rs.getString(3));
                    details.setNotes(rs.getString(4));
                    details.setImage(rs.getBytes(5));
                    details.setParentId(rs.getString(6));
                    details.setUpdateUserId(rs.getString(7));
                    details.setUpdateTime(rs.getString(8));
                    return details;
                } else
                {
                    return null;
                }

            case 19: // '\023'
                pst = con.prepareStatement("SELECT id,password,nom,prenom,droits,groups,adrln1,adrln2,ville,cp,tel1,tel2,fax,email,job,notes,msg,nb_connection,expiry_date,update_user_id,update_time,photo1,photo2 FROM utilisateurs WHERE id=?");
                pst.setString(1, (String)pk);
                rs = pst.executeQuery();
                if(rs.next())
                {
                    User user = new User();
                    user.setId(rs.getString(1));
                    user.setPassword(rs.getString(2));
                    user.setLastname(rs.getString(3));
                    user.setFirstname(rs.getString(4));
                    user.setLaw(new Integer(rs.getInt(5)));
                    user.setGroup(rs.getString(6));
                    user.setAddrLn1(rs.getString(7));
                    user.setAddrLn2(rs.getString(8));
                    user.setCity(rs.getString(9));
                    user.setZip(rs.getString(10));
                    user.setTel1(rs.getString(11));
                    user.setTel2(rs.getString(12));
                    user.setFax(rs.getString(13));
                    user.setEmail(rs.getString(14));
                    user.setJob(rs.getString(15));
                    user.setNotes(rs.getString(16));
                    user.setMsg(rs.getString(17));
                    user.setNumConsult(new Integer(rs.getInt(18)));
                    user.setExpiryDate(date.toME(rs.getString(19)));
                    user.setUserId(rs.getString(20));
                    user.setUpdateLastTime(rs.getString(21));
                    user.setPhoto1(rs.getBytes(22));
                    user.setPhoto2(rs.getBytes(23));
                    return user;
                } else
                {
                    return null;
                }

            case 48: // '0'
                pst = con.prepareStatement("SELECT id,clients_id,articles_id,remise,qt_un,qt_deux,qt_trois,remise_qt_un,remise_qt_deux,remise_qt_trois,update_user_id,update_time FROM remise_par_client WHERE id=?");
                pst.setInt(1, ((Integer)pk).intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    Discount discount = new Discount();
                    discount.setId(new Integer(rs.getInt(1)));
                    discount.setClientId(rs.getString(2));
                    discount.setArticleId(rs.getString(3));
                    discount.setRemise(rs.getBigDecimal(4));
                    discount.setQtUn(rs.getBigDecimal(5));
                    discount.setQtDeux(rs.getBigDecimal(6));
                    discount.setQtTrois(rs.getBigDecimal(7));
                    discount.setRemiseQtUn(rs.getBigDecimal(8));
                    discount.setRemiseQtDeux(rs.getBigDecimal(9));
                    discount.setRemiseQtTrois(rs.getBigDecimal(10));
                    discount.setUpdateUserId(rs.getString(11));
                    discount.setUpdateTime(rs.getString(12));
                    return discount;
                } else
                {
                    return null;
                }

            case 49: // '1'
                pst = con.prepareStatement("SELECT id,clients_id,familles_articles_id,remise,qt_un,qt_deux,qt_trois,remise_qt_un,remise_qt_deux,remise_qt_trois,update_user_id,update_time FROM remise_famart_par_client WHERE id=?");
                pst.setInt(1, ((Integer)pk).intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    Discount discount = new Discount();
                    discount.setId(new Integer(rs.getInt(1)));
                    discount.setClientId(rs.getString(2));
                    discount.setArticleId(rs.getString(3));
                    discount.setRemise(rs.getBigDecimal(4));
                    discount.setQtUn(rs.getBigDecimal(5));
                    discount.setQtDeux(rs.getBigDecimal(6));
                    discount.setQtTrois(rs.getBigDecimal(7));
                    discount.setRemiseQtUn(rs.getBigDecimal(8));
                    discount.setRemiseQtDeux(rs.getBigDecimal(9));
                    discount.setRemiseQtTrois(rs.getBigDecimal(10));
                    discount.setUpdateUserId(rs.getString(11));
                    discount.setUpdateTime(rs.getString(12));
                    return discount;
                } else
                {
                    return null;
                }

            case 16: // '\020'
                pst = con.prepareStatement("SELECT id,commerciaux_id,articles_id,debut,fin,t,update_user_id,update_time FROM comm_par_article WHERE id=?");
                pst.setInt(1, ((Integer)pk).intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    Commission commission = new Commission();
                    commission.setId(new Integer(rs.getInt(1)));
                    commission.setCommerciauxId(new Integer(rs.getInt(2)));
                    commission.setArticleId(rs.getString(3));
                    commission.setDebut(date.toME(rs.getString(4)));
                    commission.setFin(date.toME(rs.getString(5)));
                    commission.setT(rs.getBigDecimal(6));
                    commission.setUpdateUserId(rs.getString(7));
                    commission.setUpdateTime(rs.getString(8));
                    return commission;
                } else
                {
                    return null;
                }

            case 50: // '2'
                pst = con.prepareStatement("SELECT id,commerciaux_id,famille_articles_id,debut,fin,t,update_user_id,update_time FROM comm_par_famille WHERE id=?");
                pst.setInt(1, ((Integer)pk).intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    Commission commission = new Commission();
                    commission.setId(new Integer(rs.getInt(1)));
                    commission.setCommerciauxId(new Integer(rs.getInt(2)));
                    commission.setArticleId(rs.getString(3));
                    commission.setDebut(date.toME(rs.getString(4)));
                    commission.setFin(date.toME(rs.getString(5)));
                    commission.setT(rs.getBigDecimal(6));
                    commission.setUpdateUserId(rs.getString(7));
                    commission.setUpdateTime(rs.getString(8));
                    return commission;
                } else
                {
                    return null;
                }

            case 51: // '3'
                pst = con.prepareStatement("SELECT id,name,dbname,login,password,url,admin_login,admin_password,admin_url,notes,update_user_id,update_time,date FROM db WHERE id=?");
                pst.setInt(1, ((Integer)pk).intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    Db db = new Db();
                    db.setId(new Integer(rs.getInt(1)));
                    db.setName(rs.getString(2));
                    db.setDbname(rs.getString(3));
                    db.setLogin(rs.getString(4));
                    db.setPassword(rs.getString(5));
                    db.setUrl(rs.getString(6));
                    db.setAdminLogin(rs.getString(7));
                    db.setAdminPassword(rs.getString(8));
                    db.setAdminUrl(rs.getString(9));
                    db.setNotes(rs.getString(10));
                    db.setUpdateLastUserId(rs.getString(11));
                    db.setUpdateLastTime(rs.getString(12));
                    db.setDate(date.toME(rs.getString(13)));
                    return db;
                } else
                {
                    return null;
                }

            case 13: // '\r'
            case 14: // '\016'
            case 17: // '\021'
            case 23: // '\027'
            case 29: // '\035'
            default:
                return null;
            }
        }
        catch(SQLException e)
        {
            e.printStackTrace();
        }
        return null;
    }

    private Collection readSQLAll(Object pk, Object arg1, int type)
    {
        ArrayList list = new ArrayList();
        try
        {
            switch(type)
            {
            case 22: // '\026'
                pst = con.prepareStatement("SELECT id,prefixe,date,clients_id,commerciaux_id,contenu,net_a_payer,echeance,date_livraison,livre,date_relance,montant_regle,mode_reglement,solde_le,entreprise_id,prepared,total_brut_ht,commentaire,total_taxes,montant_tva1,montant_tva2,montant_tva3,montant_tva4,montant_tva5,no_fact,update_user_id,update_time,total_sous_total,tva_port FROM ventes WHERE entreprise_id=?");
                pst.setInt(1, ((Integer)pk).intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        SalesPiece piece = new SalesPiece();
                        piece.setId(rs.getString(1));
                        piece.setPrefix(rs.getString(2));
                        piece.setDate(date.toME(rs.getString(3)));
                        piece.setCustomerId(rs.getString(4));
                        piece.setSalesPersonId(new Integer(rs.getInt(5)));
                        piece.setShippingPrice(rs.getBigDecimal(6));
                        piece.setNetPrice(rs.getBigDecimal(7));
                        piece.setDueDate(date.toME(rs.getString(8)));
                        piece.setDeliveryDate(date.toME(rs.getString(9)));
                        piece.setDeliveryMan(rs.getString(10));
                        piece.setReminderDate(date.toME(rs.getString(11)));
                        piece.setPartPayment(rs.getBigDecimal(12));
                        piece.setMethodeOfPayment(rs.getString(13));
                        piece.setClearDate(date.toME(rs.getString(14)));
                        piece.setCompagnyId(new Integer(rs.getInt(15)));
                        piece.setPrepare(new Integer(rs.getInt(16)));
                        piece.setGrossPrice(rs.getBigDecimal(17));
                        piece.setNotes(rs.getString(18));
                        piece.setTotalTax(rs.getBigDecimal(19));
                        piece.setTax1(rs.getBigDecimal(20));
                        piece.setTax2(rs.getBigDecimal(21));
                        piece.setTax3(rs.getBigDecimal(22));
                        piece.setTax4(rs.getBigDecimal(23));
                        piece.setTax5(rs.getBigDecimal(24));
                        piece.setBillReference(rs.getString(25));
                        piece.setUpdateUserId(rs.getString(26));
                        piece.setUpdateTime(rs.getString(27));
                        piece.setSendingId(rs.getBigDecimal(28));
                        piece.setShippingTax(rs.getBigDecimal(29));
                        list.add(piece);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 25: // '\031'
                pst = con.prepareStatement("SELECT id,prefixe,date,clients_id,commerciaux_id,contenu,net_a_payer,echeance,date_relance,montant_regle,mode_reglement,solde_le,entreprise_id,locking,total_brut_ht,commentaire,total_taxes,montant_tva1,montant_tva2,montant_tva3,montant_tva4,montant_tva5,total_sous_total,ventes,update_user_id,update_time,tva_port FROM ventes_factures WHERE entreprise_id=?");
                pst.setInt(1, ((Integer)pk).intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        SalesBillPiece piece = new SalesBillPiece();
                        piece.setId(rs.getString(1));
                        piece.setPrefix(rs.getString(2));
                        piece.setDate(date.toME(rs.getString(3)));
                        piece.setCustomerId(rs.getString(4));
                        piece.setSalesPersonId(new Integer(rs.getInt(5)));
                        piece.setShippingPrice(rs.getBigDecimal(6));
                        piece.setNetPrice(rs.getBigDecimal(7));
                        piece.setDueDate(date.toME(rs.getString(8)));
                        piece.setReminderDate(date.toME(rs.getString(9)));
                        piece.setPartPayment(rs.getBigDecimal(10));
                        piece.setMethodeOfPayment(rs.getString(11));
                        piece.setClearDate(date.toME(rs.getString(12)));
                        piece.setCompagnyId(new Integer(rs.getInt(13)));
                        piece.setLocking(new Integer(rs.getInt(14)));
                        piece.setGrossPrice(rs.getBigDecimal(15));
                        piece.setNotes(rs.getString(16));
                        piece.setTotalTax(rs.getBigDecimal(17));
                        piece.setTax1(rs.getBigDecimal(18));
                        piece.setTax2(rs.getBigDecimal(19));
                        piece.setTax3(rs.getBigDecimal(20));
                        piece.setTax4(rs.getBigDecimal(21));
                        piece.setTax5(rs.getBigDecimal(22));
                        piece.setSubTotal(rs.getBigDecimal(23));
                        piece.setBillReference(rs.getString(24));
                        piece.setUpdateUserId(rs.getString(25));
                        piece.setUpdateTime(rs.getString(26));
                        piece.setShippingTax(rs.getBigDecimal(27));
                        list.add(piece);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 24: // '\030'
                pst = con.prepareStatement("SELECT id,date,entreprise_id,locking,fournisseurs_id,commerciaux_id,no_fact,prefixe,contenu,net_a_payer,total_brut_ht,total_taxes,montant_tva1,montant_tva2,montant_tva3,montant_tva4,montant_tva5,montant_regle,mode_reglement,recu_le,solde_le,commentaire,update_user_id,update_time,tva_port FROM achats WHERE entreprise_id=?");
                pst.setInt(1, ((Integer)pk).intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        BuysPiece piece = new BuysPiece();
                        piece.setId(rs.getString(1));
                        piece.setDate(date.toME(rs.getString(2)));
                        piece.setCompagnyId(new Integer(rs.getInt(3)));
                        piece.setLocking(new Integer(rs.getInt(4)));
                        piece.setSupplierId(rs.getString(5));
                        piece.setSalesPersonId(new Integer(rs.getInt(6)));
                        piece.setBillReference(rs.getString(7));
                        piece.setPrefix(rs.getString(8));
                        piece.setShippingPrice(rs.getBigDecimal(9));
                        piece.setNetPrice(rs.getBigDecimal(10));
                        piece.setGrossPrice(rs.getBigDecimal(11));
                        piece.setTotalTax(rs.getBigDecimal(12));
                        piece.setTax1(rs.getBigDecimal(13));
                        piece.setTax2(rs.getBigDecimal(14));
                        piece.setTax3(rs.getBigDecimal(15));
                        piece.setTax4(rs.getBigDecimal(16));
                        piece.setTax5(rs.getBigDecimal(17));
                        piece.setPartPayment(rs.getBigDecimal(18));
                        piece.setMethodeOfPayment(rs.getString(19));
                        piece.setDeliveryDate(date.toME(rs.getString(20)));
                        piece.setClearDate(date.toME(rs.getString(21)));
                        piece.setNotes(rs.getString(22));
                        piece.setUpdateUserId(rs.getString(23));
                        piece.setUpdateTime(rs.getString(24));
                        piece.setShippingTax(rs.getBigDecimal(25));
                        list.add(piece);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 27: // '\033'
                pst = con.prepareStatement("SELECT id,id_gln,raison_sociale,adresse_fact,cp_fact,ville_fact,pays_fact,adresse_livr,cp_livr,ville_livr,pays_livr,mode_reglement,civilite,no_compte,commerciaux_id,contact,fonction_contact,telephone,portable,fax,email,site_web,familles_clients_id,remise,remise_excep,echeance_paiement,total_encaisse,cota_fidelite,commentaire,adresse2_fact,adresse2_livr,banque,update_user_id,update_time,photo1,photo2 FROM clients WHERE familles_clients_id=?");
                pst.setInt(1, ((Integer)pk).intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        Customer customer = new Customer();
                        customer.setId(rs.getString(1));
                        customer.setIdGLN(rs.getString(2));
                        customer.setRaisonSociale(rs.getString(3));
                        customer.setAdresseFactUn(rs.getString(4));
                        customer.setCpFact(rs.getString(5));
                        customer.setVilleFact(rs.getString(6));
                        customer.setPaysFact(rs.getString(7));
                        customer.setAdresseLivrUn(rs.getString(8));
                        customer.setCpLivr(rs.getString(9));
                        customer.setVilleLivr(rs.getString(10));
                        customer.setPaysLivr(rs.getString(11));
                        customer.setModeReglement(rs.getString(12));
                        customer.setCivilite(rs.getString(13));
                        customer.setNumeroCompte(rs.getString(14));
                        customer.setCommerciauxId(new Integer(rs.getInt(15)));
                        customer.setNomPrenomContact(rs.getString(16));
                        customer.setFonctionContact(rs.getString(17));
                        customer.setTelephone(rs.getString(18));
                        customer.setPortable(rs.getString(19));
                        customer.setFax(rs.getString(20));
                        customer.setEmail(rs.getString(21));
                        customer.setSiteWeb(rs.getString(22));
                        customer.setFamilleClientId(rs.getString(23));
                        customer.setRemise(rs.getBigDecimal(24));
                        customer.setRemiseFidelite(rs.getBigDecimal(25));
                        customer.setEcheancePaiement(rs.getBigDecimal(26));
                        customer.setTotalEncaisser(rs.getBigDecimal(27));
                        customer.setCotaFidelite(rs.getBigDecimal(28));
                        customer.setCommentaire(rs.getString(29));
                        customer.setAdresseFactDeux(rs.getString(30));
                        customer.setAdresseLivrDeux(rs.getString(31));
                        customer.setBanque(rs.getString(32));
                        customer.setUserId(rs.getString(33));
                        customer.setUpdateLastTime(rs.getString(34));
                        customer.setPhoto1(rs.getBytes(35));
                        customer.setPhoto2(rs.getBytes(36));
                        list.add(customer);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 9: // '\t'
                pst = con.prepareStatement("SELECT id,raison_sociale,adresse_com,cp_com,ville_com,pays_com,adresse_enlev,cp_enlev,ville_enlev,pays_enlev,civilite,no_compte,contact,fonction_contact,telephone,portable,fax,email,site_web,familles_fournisseurs_id,commentaire,adresse2_com,adresse2_enlev,update_user_id,update_time,gln,photo1,photo2 FROM fournisseurs");
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        Supplier supplier = new Supplier();
                        supplier.setId(rs.getString(1));
                        supplier.setRaisonSociale(rs.getString(2));
                        supplier.setAdresseComUn(rs.getString(3));
                        supplier.setCpCom(rs.getString(4));
                        supplier.setVilleCom(rs.getString(5));
                        supplier.setPaysCom(rs.getString(6));
                        supplier.setAdresseEnlevUn(rs.getString(7));
                        supplier.setCpEnlev(rs.getString(8));
                        supplier.setVilleEnlev(rs.getString(9));
                        supplier.setPaysEnlev(rs.getString(10));
                        supplier.setCivilite(rs.getString(11));
                        supplier.setNumeroCompte(rs.getString(12));
                        supplier.setNomPrenomContact(rs.getString(13));
                        supplier.setFonctionContact(rs.getString(14));
                        supplier.setTelephone(rs.getString(15));
                        supplier.setPortable(rs.getString(16));
                        supplier.setFax(rs.getString(17));
                        supplier.setEmail(rs.getString(18));
                        supplier.setSiteWeb(rs.getString(19));
                        supplier.setFamilleFournisseurId(rs.getString(20));
                        supplier.setCommentaire(rs.getString(21));
                        supplier.setAdresseComDeux(rs.getString(22));
                        supplier.setAdresseEnlevDeux(rs.getString(23));
                        supplier.setUserId(rs.getString(24));
                        supplier.setUpdateLastTime(rs.getString(25));
                        supplier.setGln(rs.getString(26));
                        supplier.setPhoto1(rs.getBytes(27));
                        supplier.setPhoto2(rs.getBytes(28));
                        list.add(supplier);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 11: // '\013'
                pst = con.prepareStatement("SELECT designation,familles_articles_id,ref_code_barre,price_list2,price_list3,price_list4,tva_id,fournisseurs_id,promotion,emplacement,web,prix_revient,price_list1,commentaire,alerte,unite_vente,update_user_id,update_time,date2,date3,date4,date,detail_revient,free1,free2,prix_achat_pondere,packaging,gtin,photo1,photo2,photo3,photo4,photo5,photo6,photo7,photo8,photo9,photo10,photos_valid,description FROM articles WHERE familles_articles_id=?");
                pst.setInt(1, ((Integer)pk).intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        Item item = new Item();
                        item.setDesignation(rs.getString(1));
                        item.setFamillesArticlesId(rs.getString(2));
                        item.setId(rs.getString(3));
                        item.setPriceList2(rs.getBigDecimal(4));
                        item.setPriceList3(rs.getBigDecimal(5));
                        item.setPriceList4(rs.getBigDecimal(6));
                        item.setTvaId(new Integer(rs.getInt(7)));
                        item.setFournisseurId(rs.getString(8));
                        item.setPromotion(rs.getBigDecimal(9));
                        item.setEmplacement(rs.getString(10));
                        item.setWeb(rs.getString(11));
                        item.setPrixRevient(rs.getBigDecimal(12));
                        item.setPriceList1(rs.getBigDecimal(13));
                        item.setCommentaire(rs.getString(14));
                        item.setAlerte(rs.getBigDecimal(15));
                        item.setUniteVente(rs.getString(16));
                        item.setUserId(rs.getString(17));
                        item.setUpdateLastTime(rs.getString(18));
                        item.setDate2(date.toME(rs.getString(19)));
                        item.setDate3(date.toME(rs.getString(20)));
                        item.setDate4(date.toME(rs.getString(21)));
                        item.setDate(date.toME(rs.getString(22)));
                        item.setDetailRevient(rs.getString(23));
                        item.setFree1(rs.getString(24));
                        item.setFree2(rs.getString(25));
                        item.setPrixAchatPondere(rs.getBigDecimal(26));
                        item.setPackaging(new Integer(rs.getInt(27)));
                        item.setGtin(rs.getString(28));
                        item.setPhoto1(rs.getBytes(29));
                        item.setPhoto2(rs.getBytes(30));
                        item.setPhoto3(rs.getBytes(31));
                        item.setPhoto4(rs.getBytes(32));
                        item.setPhoto5(rs.getBytes(33));
                        item.setPhoto6(rs.getBytes(34));
                        item.setPhoto7(rs.getBytes(35));
                        item.setPhoto8(rs.getBytes(36));
                        item.setPhoto9(rs.getBytes(37));
                        item.setPhoto10(rs.getBytes(38));
                        item.setPhotosValid(rs.getString(39));
                        item.setDescription(rs.getString(40));
                        list.add(item);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 26: // '\032'
                pst = con.prepareStatement("SELECT id,prefix,piece_id,montant,mode,date,pointage,numero,update_user_id,update_time FROM reglements_clients WHERE piece_id=? AND prefix=?");
                pst.setString(1, (String)pk);
                pst.setString(2, (String)arg1);
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        Payment payment = new Payment();
                        payment.setId(new Integer(rs.getInt(1)));
                        payment.setPrefix(rs.getString(2));
                        payment.setPieceId(rs.getString(3));
                        payment.setMontant(rs.getBigDecimal(4));
                        payment.setMode(rs.getString(5));
                        payment.setDate(date.toME(rs.getString(6)));
                        payment.setPointage(rs.getString(7));
                        payment.setNumero(rs.getString(8));
                        payment.setUserId(rs.getString(9));
                        payment.setUpdateLastTime(rs.getString(10));
                        list.add(payment);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 20: // '\024'
                pst = con.prepareStatement("SELECT id,piece_id,date,status,notes,update_user_id,update_time FROM reminder WHERE piece_id=?");
                pst.setString(1, (String)pk);
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        Reminder reminder = new Reminder();
                        reminder.setId(new Integer(rs.getInt(1)));
                        reminder.setPieceId(rs.getString(2));
                        reminder.setDate(date.toME(rs.getString(3)));
                        reminder.setStatus(new Integer(rs.getInt(4)));
                        reminder.setNotes(rs.getString(5));
                        reminder.setUserId(rs.getString(6));
                        reminder.setUpdateLastTime(rs.getString(7));
                        list.add(reminder);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 15: // '\017'
                pst = con.prepareStatement("SELECT id,nom,prenom,secteur,telephone,portable,fax,email,niveau,taux_vente,taux_total_vente,resultat,resultat_date,objectif,objectif_date,commentaire,update_user_id,update_time,sales_person_family_id,addr_ln1,addr_ln2,zip,city,country FROM commerciaux ORDER BY nom");
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        SalesPerson salesPerson = new SalesPerson();
                        salesPerson.setId(new Integer(rs.getInt(1)));
                        salesPerson.setNom(rs.getString(2));
                        salesPerson.setPrenom(rs.getString(3));
                        salesPerson.setSecteur(rs.getString(4));
                        salesPerson.setTelephone(rs.getString(5));
                        salesPerson.setPortable(rs.getString(6));
                        salesPerson.setFax(rs.getString(7));
                        salesPerson.setEmail(rs.getString(8));
                        salesPerson.setNiveau(rs.getString(9));
                        salesPerson.setTauxVente(rs.getBigDecimal(10));
                        salesPerson.setTauxTotalVente(rs.getBigDecimal(11));
                        salesPerson.setResultat(rs.getBigDecimal(12));
                        salesPerson.setResultatDate(date.toME(rs.getString(13)));
                        salesPerson.setObjectif(rs.getBigDecimal(14));
                        salesPerson.setObjectifDate(date.toME(rs.getString(15)));
                        salesPerson.setCommentaire(rs.getString(16));
                        salesPerson.setUserId(rs.getString(17));
                        salesPerson.setUpdateLastTime(rs.getString(18));
                        salesPerson.setSalesPersonFamily(rs.getString(19));
                        salesPerson.setAddrLn1(rs.getString(20));
                        salesPerson.setAddrLn2(rs.getString(21));
                        salesPerson.setZip(rs.getString(22));
                        salesPerson.setCity(rs.getString(23));
                        salesPerson.setCountry(rs.getString(24));
                        list.add(salesPerson);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 21: // '\025'
                pst = con.prepareStatement("SELECT id,raison_sociale,civilite,adresse,cp,ville,pays,telephone,fax,email,siret,naf,site_web,adresse2,telephone_deux,telephone_trois,fax_deux,fax_trois,update_user_id,update_time,gln,photo1,photo2,notes FROM entreprise ORDER BY id");
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        Agency agency = new Agency();
                        agency.setId(new Integer(rs.getInt(1)));
                        agency.setRaisonSociale(rs.getString(2));
                        agency.setCivilite(rs.getString(3));
                        agency.setAdresseUn(rs.getString(4));
                        agency.setCp(rs.getString(5));
                        agency.setVille(rs.getString(6));
                        agency.setPays(rs.getString(7));
                        agency.setTelephoneUn(rs.getString(8));
                        agency.setFaxUn(rs.getString(9));
                        agency.setEmail(rs.getString(10));
                        agency.setSiret(rs.getString(11));
                        agency.setNaf(rs.getString(12));
                        agency.setSiteWeb(rs.getString(13));
                        agency.setAdresseDeux(rs.getString(14));
                        agency.setTelephoneDeux(rs.getString(15));
                        agency.setTelephoneTrois(rs.getString(16));
                        agency.setFaxDeux(rs.getString(17));
                        agency.setFaxTrois(rs.getString(18));
                        agency.setUserId(rs.getString(19));
                        agency.setUpdateLastTime(rs.getString(20));
                        agency.setGln(rs.getString(21));
                        agency.setPhoto1(rs.getBytes(22));
                        agency.setPhoto2(rs.getBytes(23));
                        agency.setNotes(rs.getString(24));
                        list.add(agency);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 28: // '\034'
                pst = con.prepareStatement("SELECT id,line,status,facture_id,vente_id,article_id,designation,tva_id,lot_id,reliquat_id,quantite,prix_vente,prix_unitaire,total_ht,remise,update_user_id,update_time,batch_id FROM contenu WHERE vente_id=? ORDER BY line");
                pst.setString(1, (String)pk);
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        OrderRow row = new OrderRow();
                        row.setId(new Integer(rs.getInt(1)));
                        row.setLine(new Integer(rs.getInt(2)));
                        row.setStatus(rs.getBigDecimal(3));
                        row.setFactureId(rs.getString(4));
                        row.setVenteId(rs.getString(5));
                        row.setArticleId(rs.getString(6));
                        row.setDesignation(rs.getString(7));
                        row.setTvaId(new Integer(rs.getInt(8)));
                        row.setLotId(rs.getString(9));
                        row.setReliquatId(new Integer(rs.getInt(10)));
                        row.setQuantite(rs.getBigDecimal(11));
                        row.setPrixVente(rs.getBigDecimal(12));
                        row.setPrixUnitaire(rs.getBigDecimal(13));
                        row.setTotalHt(rs.getBigDecimal(14));
                        row.setRemise(rs.getBigDecimal(15));
                        row.setUserId(rs.getString(16));
                        row.setUpdateLastTime(rs.getString(17));
                        row.setBatchId(new Integer(rs.getInt(18)));
                        list.add(row);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 29: // '\035'
                pst = con.prepareStatement("SELECT id,line,status,facture_id,vente_id,article_id,designation,tva_id,lot_id,reliquat_id,quantite,prix_vente,prix_unitaire,total_ht,remise,update_user_id,update_time,batch_id FROM contenu WHERE facture_id=? ORDER BY line");
                pst.setString(1, (String)pk);
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        OrderRow row = new OrderRow();
                        row.setId(new Integer(rs.getInt(1)));
                        row.setLine(new Integer(rs.getInt(2)));
                        row.setStatus(rs.getBigDecimal(3));
                        row.setFactureId(rs.getString(4));
                        row.setVenteId(rs.getString(5));
                        row.setArticleId(rs.getString(6));
                        row.setDesignation(rs.getString(7));
                        row.setTvaId(new Integer(rs.getInt(8)));
                        row.setLotId(rs.getString(9));
                        row.setReliquatId(new Integer(rs.getInt(10)));
                        row.setQuantite(rs.getBigDecimal(11));
                        row.setPrixVente(rs.getBigDecimal(12));
                        row.setPrixUnitaire(rs.getBigDecimal(13));
                        row.setTotalHt(rs.getBigDecimal(14));
                        row.setRemise(rs.getBigDecimal(15));
                        row.setUserId(rs.getString(16));
                        row.setUpdateLastTime(rs.getString(17));
                        row.setBatchId(new Integer(rs.getInt(18)));
                        list.add(row);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 30: // '\036'
                pst = con.prepareStatement("SELECT id,line,status,facture_id,vente_id,article_id,designation,tva_id,lot_id,reliquat_id,quantite,prix_vente,prix_unitaire,total_ht,remise,update_user_id,update_time,batch_id FROM contenu_a WHERE vente_id=? ORDER BY line");
                pst.setString(1, (String)pk);
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        OrderRow row = new OrderRow();
                        row.setId(new Integer(rs.getInt(1)));
                        row.setLine(new Integer(rs.getInt(2)));
                        row.setStatus(rs.getBigDecimal(3));
                        row.setFactureId(rs.getString(4));
                        row.setVenteId(rs.getString(5));
                        row.setArticleId(rs.getString(6));
                        row.setDesignation(rs.getString(7));
                        row.setTvaId(new Integer(rs.getInt(8)));
                        row.setLotId(rs.getString(9));
                        row.setReliquatId(new Integer(rs.getInt(10)));
                        row.setQuantite(rs.getBigDecimal(11));
                        row.setPrixVente(rs.getBigDecimal(12));
                        row.setPrixUnitaire(rs.getBigDecimal(13));
                        row.setTotalHt(rs.getBigDecimal(14));
                        row.setRemise(rs.getBigDecimal(15));
                        row.setUserId(rs.getString(16));
                        row.setUpdateLastTime(rs.getString(17));
                        row.setBatchId(new Integer(rs.getInt(18)));
                        list.add(row);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 18: // '\022'
                pst = con.prepareStatement("SELECT id,taux,update_user_id,update_time FROM tva ORDER BY id");
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        Tax tax = new Tax();
                        tax.setId(new Integer(rs.getInt(1)));
                        tax.setTaux(rs.getBigDecimal(2));
                        tax.setUserId(rs.getString(3));
                        tax.setUpdateLastTime(rs.getString(4));
                        list.add(tax);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 31: // '\037'
                pst = con.prepareStatement("SELECT id,buy_id,sscc,trucking_company,pallet_gtin,box_gtin,item_gtin,item_id,item_batch,delivery_form,supplier_gln,supplier_id,agency_id,input_stock_date,inventory_date,dlc,dluo,input_stock_quantity,stock_quantity,delta_inventory,packaging,unit,batch_price,status,notes,update_user_id,update_time FROM batch WHERE agency_id=? AND item_batch=? ORDER BY id");
                pst.setInt(1, ((Integer)pk).intValue());
                pst.setInt(2, ((Integer)arg1).intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        Batch batch = new Batch();
                        batch.setId(new Integer(rs.getInt(1)));
                        batch.setBuyId(rs.getString(2));
                        batch.setSscc(rs.getString(3));
                        batch.setTruckingCompagny(rs.getString(4));
                        batch.setPalletGTIN(rs.getString(5));
                        batch.setBoxGTIN(rs.getString(6));
                        batch.setItemGTIN(rs.getString(7));
                        batch.setItemId(rs.getString(8));
                        batch.setItemBatch(rs.getString(9));
                        batch.setDeliveryForm(rs.getString(10));
                        batch.setSupplierGLN(rs.getString(11));
                        batch.setSupplierId(rs.getString(12));
                        batch.setAgencyId(new Integer(rs.getInt(13)));
                        batch.setInputStockDate(date.toME(rs.getString(14)));
                        batch.setInventoryDate(date.toME(rs.getString(15)));
                        batch.setDateDLC(date.toME(rs.getString(16)));
                        batch.setDateDLUO(date.toME(rs.getString(17)));
                        batch.setInputStockQuantity(rs.getBigDecimal(18));
                        batch.setStockQuantity(rs.getBigDecimal(19));
                        batch.setDeltaInventory(rs.getBigDecimal(20));
                        batch.setPackaging(rs.getBigDecimal(21));
                        batch.setUnit(rs.getString(22));
                        batch.setBatchPrice(rs.getBigDecimal(23));
                        batch.setStatus(new Integer(rs.getInt(24)));
                        batch.setNotes(rs.getString(25));
                        batch.setUserId(rs.getString(26));
                        batch.setUpdateLastTime(rs.getString(27));
                        list.add(batch);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 32: // ' '
                pst = con.prepareStatement("SELECT id,operation,de,vers,quantite,date,update_user_id,update_time,articles_id,no_lot,commentaire FROM journal_stock ORDER BY id");
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        LogStock logStock = new LogStock();
                        logStock.setId(new Integer(rs.getInt(1)));
                        logStock.setOperation(rs.getString(2));
                        logStock.setDe(rs.getString(3));
                        logStock.setVers(rs.getString(4));
                        logStock.setQuantity(rs.getBigDecimal(5));
                        logStock.setDate(date.toME(rs.getString(6)));
                        logStock.setUserId(rs.getString(7));
                        logStock.setUpdateLastTime(rs.getString(8));
                        logStock.setItemId(rs.getString(9));
                        logStock.setBatchId(new Integer(rs.getInt(10)));
                        logStock.setNotes(rs.getString(11));
                        list.add(logStock);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 33: // '!'
                pst = con.prepareStatement("SELECT id,order_id,sscc,trucking_company,pallet_gtin,box_gtin,delivery_form,supplier_gln,supplier_id,agency_id,sending_date,preparation_date,delivery_anticipated_date,delivery_date,weight,parcel_quantity,packaging,unit,insurance_value,insurance_company,status,notes,update_user_id,update_time FROM sending WHERE order_id=? ORDER BY id");
                pst.setString(1, (String)pk);
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        Sending sending = new Sending();
                        sending.setId(new Integer(rs.getInt(1)));
                        sending.setOrderId(rs.getString(2));
                        sending.setSscc(rs.getString(3));
                        sending.setTruckingCompagny(rs.getString(4));
                        sending.setPalletGTIN(rs.getString(5));
                        sending.setBoxGTIN(rs.getString(6));
                        sending.setDeliveryForm(rs.getString(7));
                        sending.setCustomerGLN(rs.getString(8));
                        sending.setCustomerId(rs.getString(9));
                        sending.setAgencyId(new Integer(rs.getInt(10)));
                        sending.setSendingDate(date.toME(rs.getString(11)));
                        sending.setPreparationDate(date.toME(rs.getString(12)));
                        sending.setDeliveryAnticipatedDate(date.toME(rs.getString(13)));
                        sending.setDeliveryDate(date.toME(rs.getString(14)));
                        sending.setWeight(rs.getBigDecimal(15));
                        sending.setParcelQuantity(rs.getBigDecimal(16));
                        sending.setPackaging(rs.getBigDecimal(17));
                        sending.setUnit(rs.getString(18));
                        sending.setInsuranceValue(rs.getBigDecimal(19));
                        sending.setInsuranceCompany(rs.getString(20));
                        sending.setStatus(new Integer(rs.getInt(21)));
                        sending.setNotes(rs.getString(22));
                        sending.setUserId(rs.getString(23));
                        sending.setUpdateLastTime(rs.getString(24));
                        list.add(sending);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 34: // '"'
                pst = con.prepareStatement("SELECT id,time FROM numero_achat ORDER BY id");
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        Number number = new Number();
                        number.setId(new Integer(rs.getInt(1)));
                        number.setTime(rs.getString(2));
                        list.add(number);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 35: // '#'
                pst = con.prepareStatement("SELECT id,time FROM numero_expedition ORDER BY id");
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        Number number = new Number();
                        number.setId(new Integer(rs.getInt(1)));
                        number.setTime(rs.getString(2));
                        list.add(number);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 36: // '$'
                pst = con.prepareStatement("SELECT id,time FROM numero_facture ORDER BY id");
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        Number number = new Number();
                        number.setId(new Integer(rs.getInt(1)));
                        number.setTime(rs.getString(2));
                        list.add(number);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 37: // '%'
                pst = con.prepareStatement("SELECT id,time FROM numero_lot ORDER BY id");
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        Number number = new Number();
                        number.setId(new Integer(rs.getInt(1)));
                        number.setTime(rs.getString(2));
                        list.add(number);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 38: // '&'
                pst = con.prepareStatement("SELECT id,time FROM numero_vente ORDER BY id");
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        Number number = new Number();
                        number.setId(new Integer(rs.getInt(1)));
                        number.setTime(rs.getString(2));
                        list.add(number);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 12: // '\f'
                pst = con.prepareStatement("SELECT id,designation,coefficient,update_user_id,update_time FROM familles_articles ORDER BY id");
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        Family family = new Family();
                        family.setId(rs.getString(1));
                        family.setDesignation(rs.getString(2));
                        family.setCoefficient(rs.getBigDecimal(3));
                        family.setUpdateUserId(rs.getString(4));
                        family.setUpdateTime(rs.getString(5));
                        list.add(family);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 46: // '.'
                pst = con.prepareStatement("SELECT id,designation,coefficient,update_user_id,update_time FROM familles_clients ORDER BY id");
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        Family family = new Family();
                        family.setId(rs.getString(1));
                        family.setDesignation(rs.getString(2));
                        family.setCoefficient(rs.getBigDecimal(3));
                        family.setUpdateUserId(rs.getString(4));
                        family.setUpdateTime(rs.getString(5));
                        list.add(family);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 10: // '\n'
                pst = con.prepareStatement("SELECT id,designation,coefficient,update_user_id,update_time FROM familles_fournisseurs ORDER BY id");
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        Family family = new Family();
                        family.setId(rs.getString(1));
                        family.setDesignation(rs.getString(2));
                        family.setCoefficient(rs.getBigDecimal(3));
                        family.setUpdateUserId(rs.getString(4));
                        family.setUpdateTime(rs.getString(5));
                        list.add(family);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 39: // '\''
                pst = con.prepareStatement("SELECT id,designation,coefficient,update_user_id,update_time FROM sales_person_family ORDER BY id");
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        Family family = new Family();
                        family.setId(rs.getString(1));
                        family.setDesignation(rs.getString(2));
                        family.setCoefficient(rs.getBigDecimal(3));
                        family.setUpdateUserId(rs.getString(4));
                        family.setUpdateTime(rs.getString(5));
                        list.add(family);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 40: // '('
                pst = con.prepareStatement("SELECT id,name,category,update_user_id,update_time FROM detail_list WHERE category=? ORDER BY id");
                pst.setString(1, (String)pk);
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        DetailsList detailsList = new DetailsList();
                        detailsList.setId(new Integer(rs.getInt(1)));
                        detailsList.setName(rs.getString(2));
                        detailsList.setCategory(rs.getString(3));
                        detailsList.setUpdateUserId(rs.getString(4));
                        detailsList.setUpdateTime(rs.getString(5));
                        list.add(detailsList);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 41: // ')'
                pst = con.prepareStatement("SELECT id,detail_list_id,value,notes,image,parent_id,update_user_id,update_time FROM detail_articles ORDER BY id");
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        Details details = new Details();
                        details.setId(new Integer(rs.getInt(1)));
                        details.setDetailListId(new Integer(rs.getInt(2)));
                        details.setValue(rs.getString(3));
                        details.setNotes(rs.getString(4));
                        details.setImage(rs.getBytes(5));
                        details.setParentId(rs.getString(6));
                        details.setUpdateUserId(rs.getString(7));
                        details.setUpdateTime(rs.getString(8));
                        list.add(details);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 42: // '*'
                pst = con.prepareStatement("SELECT id,detail_list_id,value,notes,image,parent_id,update_user_id,update_time FROM detail_clients ORDER BY id");
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        Details details = new Details();
                        details.setId(new Integer(rs.getInt(1)));
                        details.setDetailListId(new Integer(rs.getInt(2)));
                        details.setValue(rs.getString(3));
                        details.setNotes(rs.getString(4));
                        details.setImage(rs.getBytes(5));
                        details.setParentId(rs.getString(6));
                        details.setUpdateUserId(rs.getString(7));
                        details.setUpdateTime(rs.getString(8));
                        list.add(details);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 44: // ','
                pst = con.prepareStatement("SELECT id,detail_list_id,value,notes,image,parent_id,update_user_id,update_time FROM detail_commerciaux ORDER BY id");
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        Details details = new Details();
                        details.setId(new Integer(rs.getInt(1)));
                        details.setDetailListId(new Integer(rs.getInt(2)));
                        details.setValue(rs.getString(3));
                        details.setNotes(rs.getString(4));
                        details.setImage(rs.getBytes(5));
                        details.setParentId(new Integer(rs.getInt(6)));
                        details.setUpdateUserId(rs.getString(7));
                        details.setUpdateTime(rs.getString(8));
                        list.add(details);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 45: // '-'
                pst = con.prepareStatement("SELECT id,detail_list_id,value,notes,image,parent_id,update_user_id,update_time FROM detail_entreprise ORDER BY id");
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        Details details = new Details();
                        details.setId(new Integer(rs.getInt(1)));
                        details.setDetailListId(new Integer(rs.getInt(2)));
                        details.setValue(rs.getString(3));
                        details.setNotes(rs.getString(4));
                        details.setImage(rs.getBytes(5));
                        details.setParentId(new Integer(rs.getInt(6)));
                        details.setUpdateUserId(rs.getString(7));
                        details.setUpdateTime(rs.getString(8));
                        list.add(details);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 43: // '+'
                pst = con.prepareStatement("SELECT id,detail_list_id,value,notes,image,parent_id,update_user_id,update_time FROM detail_fournisseurs ORDER BY id");
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        Details details = new Details();
                        details.setId(new Integer(rs.getInt(1)));
                        details.setDetailListId(new Integer(rs.getInt(2)));
                        details.setValue(rs.getString(3));
                        details.setNotes(rs.getString(4));
                        details.setImage(rs.getBytes(5));
                        details.setParentId(rs.getString(6));
                        details.setUpdateUserId(rs.getString(7));
                        details.setUpdateTime(rs.getString(8));
                        list.add(details);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 47: // '/'
                pst = con.prepareStatement("SELECT id,detail_list_id,value,notes,image,parent_id,update_user_id,update_time FROM detail_utilisateurs ORDER BY id");
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        Details details = new Details();
                        details.setId(new Integer(rs.getInt(1)));
                        details.setDetailListId(new Integer(rs.getInt(2)));
                        details.setValue(rs.getString(3));
                        details.setNotes(rs.getString(4));
                        details.setImage(rs.getBytes(5));
                        details.setParentId(rs.getString(6));
                        details.setUpdateUserId(rs.getString(7));
                        details.setUpdateTime(rs.getString(8));
                        list.add(details);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 19: // '\023'
                pst = con.prepareStatement("SELECT id,password,nom,prenom,droits,groups,adrln1,adrln2,ville,cp,tel1,tel2,fax,email,job,notes,msg,nb_connection,expiry_date,update_user_id,update_time,photo1,photo2 FROM utilisateurs ORDER BY id");
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        User user = new User();
                        user.setId(rs.getString(1));
                        user.setPassword(rs.getString(2));
                        user.setLastname(rs.getString(3));
                        user.setFirstname(rs.getString(4));
                        user.setLaw(new Integer(rs.getInt(5)));
                        user.setGroup(rs.getString(6));
                        user.setAddrLn1(rs.getString(7));
                        user.setAddrLn2(rs.getString(8));
                        user.setCity(rs.getString(9));
                        user.setZip(rs.getString(10));
                        user.setTel1(rs.getString(11));
                        user.setTel2(rs.getString(12));
                        user.setFax(rs.getString(13));
                        user.setEmail(rs.getString(14));
                        user.setJob(rs.getString(15));
                        user.setNotes(rs.getString(16));
                        user.setMsg(rs.getString(17));
                        user.setNumConsult(new Integer(rs.getInt(18)));
                        user.setExpiryDate(date.toME(rs.getString(19)));
                        user.setUserId(rs.getString(20));
                        user.setUpdateLastTime(rs.getString(21));
                        user.setPhoto1(rs.getBytes(22));
                        user.setPhoto2(rs.getBytes(23));
                        list.add(user);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 48: // '0'
                pst = con.prepareStatement("SELECT id,clients_id,articles_id,remise,qt_un,qt_deux,qt_trois,remise_qt_un,remise_qt_deux,remise_qt_trois,update_user_id,update_time FROM remise_par_client WHERE clients_id=? ORDER BY articles_id");
                pst.setString(1, (String)pk);
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        Discount discount = new Discount();
                        discount.setId(new Integer(rs.getInt(1)));
                        discount.setClientId(rs.getString(2));
                        discount.setArticleId(rs.getString(3));
                        discount.setRemise(rs.getBigDecimal(4));
                        discount.setQtUn(rs.getBigDecimal(5));
                        discount.setQtDeux(rs.getBigDecimal(6));
                        discount.setQtTrois(rs.getBigDecimal(7));
                        discount.setRemiseQtUn(rs.getBigDecimal(8));
                        discount.setRemiseQtDeux(rs.getBigDecimal(9));
                        discount.setRemiseQtTrois(rs.getBigDecimal(10));
                        discount.setUpdateUserId(rs.getString(11));
                        discount.setUpdateTime(rs.getString(12));
                        list.add(discount);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 49: // '1'
                pst = con.prepareStatement("SELECT id,clients_id,familles_articles_id,remise,qt_un,qt_deux,qt_trois,remise_qt_un,remise_qt_deux,remise_qt_trois,update_user_id,update_time FROM remise_famart_par_client WHERE clients_id=? ORDER BY familles_articles_id");
                pst.setString(1, (String)pk);
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        Discount discount = new Discount();
                        discount.setId(new Integer(rs.getInt(1)));
                        discount.setClientId(rs.getString(2));
                        discount.setArticleId(rs.getString(3));
                        discount.setRemise(rs.getBigDecimal(4));
                        discount.setQtUn(rs.getBigDecimal(5));
                        discount.setQtDeux(rs.getBigDecimal(6));
                        discount.setQtTrois(rs.getBigDecimal(7));
                        discount.setRemiseQtUn(rs.getBigDecimal(8));
                        discount.setRemiseQtDeux(rs.getBigDecimal(9));
                        discount.setRemiseQtTrois(rs.getBigDecimal(10));
                        discount.setUpdateUserId(rs.getString(11));
                        discount.setUpdateTime(rs.getString(12));
                        list.add(discount);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 16: // '\020'
                pst = con.prepareStatement("SELECT id,commerciaux_id,articles_id,debut,fin,t,update_user_id,update_time FROM comm_par_article WHERE commerciaux_id=? ORDER BY articles_id");
                pst.setInt(1, ((Integer)pk).intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        Commission commission = new Commission();
                        commission.setId(new Integer(rs.getInt(1)));
                        commission.setCommerciauxId(new Integer(rs.getInt(2)));
                        commission.setArticleId(rs.getString(3));
                        commission.setDebut(date.toME(rs.getString(4)));
                        commission.setFin(date.toME(rs.getString(5)));
                        commission.setT(rs.getBigDecimal(6));
                        commission.setUpdateUserId(rs.getString(7));
                        commission.setUpdateTime(rs.getString(8));
                        list.add(commission);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 50: // '2'
                pst = con.prepareStatement("SELECT id,commerciaux_id,famille_articles_id,debut,fin,t,update_user_id,update_time FROM comm_par_famille WHERE commerciaux_id=? ORDER BY famille_articles_id");
                pst.setInt(1, ((Integer)pk).intValue());
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        Commission commission = new Commission();
                        commission.setId(new Integer(rs.getInt(1)));
                        commission.setCommerciauxId(new Integer(rs.getInt(2)));
                        commission.setArticleId(rs.getString(3));
                        commission.setDebut(date.toME(rs.getString(4)));
                        commission.setFin(date.toME(rs.getString(5)));
                        commission.setT(rs.getBigDecimal(6));
                        commission.setUpdateUserId(rs.getString(7));
                        commission.setUpdateTime(rs.getString(8));
                        list.add(commission);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 51: // '3'
                pst = con.prepareStatement("SELECT id,name,dbname,login,password,url,admin_login,admin_password,admin_url,notes,update_user_id,update_time,date FROM db");
                rs = pst.executeQuery();
                if(rs.next())
                {
                    do
                    {
                        Db db = new Db();
                        db.setId(new Integer(rs.getInt(1)));
                        db.setName(rs.getString(2));
                        db.setDbname(rs.getString(3));
                        db.setLogin(rs.getString(4));
                        db.setPassword(rs.getString(5));
                        db.setUrl(rs.getString(6));
                        db.setAdminLogin(rs.getString(7));
                        db.setAdminPassword(rs.getString(8));
                        db.setAdminUrl(rs.getString(9));
                        db.setNotes(rs.getString(10));
                        db.setUpdateLastUserId(rs.getString(11));
                        db.setUpdateLastTime(rs.getString(12));
                        db.setDate(date.toME(rs.getString(13)));
                        list.add(db);
                    } while(rs.next());
                    return list;
                } else
                {
                    return null;
                }

            case 13: // '\r'
            case 14: // '\016'
            case 17: // '\021'
            case 23: // '\027'
            default:
                return null;
            }
        }
        catch(SQLException e)
        {
            e.printStackTrace();
        }
        return null;
    }

    private boolean updateSQL(Object obj, int type)
    {
        try
        {
            switch(type)
            {
            case 22: // '\026'
                SalesPiece piece = (SalesPiece)obj;
                pst = con.prepareStatement("UPDATE ventes SET id=?,prefixe=?,date=?,clients_id=?,commerciaux_id=?,contenu=?,net_a_payer=?,echeance=?,date_livraison=?,livre=?,date_relance=?,montant_regle=?,mode_reglement=?,solde_le=?,entreprise_id=?,prepared=?,total_brut_ht=?,commentaire=?,total_taxes=?,montant_tva1=?,montant_tva2=?,montant_tva3=?,montant_tva4=?,montant_tva5=?,no_fact=?,update_user_id=?,update_time=?,total_sous_total=?,tva_port=? WHERE id=? AND update_time=?");
                pst.setString(1, piece.getId());
                pst.setString(2, piece.getPrefix());
                pst.setString(3, date.toMysql(piece.getDate()));
                pst.setString(4, piece.getCustomerId());
                pst.setInt(5, piece.getSalesPersonId().intValue());
                pst.setBigDecimal(6, piece.getShippingPrice());
                pst.setBigDecimal(7, piece.getNetPrice());
                pst.setString(8, date.toMysql(piece.getDueDate()));
                pst.setString(9, date.toMysql(piece.getDeliveryDate()));
                pst.setString(10, piece.getDeliveryMan());
                pst.setString(11, date.toMysql(piece.getReminderDate()));
                pst.setBigDecimal(12, piece.getPartPayment());
                pst.setString(13, piece.getMethodeOfPayment());
                pst.setString(14, date.toMysql(piece.getClearDate()));
                pst.setInt(15, piece.getCompagnyId().intValue());
                pst.setInt(16, piece.getPrepare().intValue());
                pst.setBigDecimal(17, piece.getGrossPrice());
                pst.setString(18, piece.getNotes());
                pst.setBigDecimal(19, piece.getTotalTax());
                pst.setBigDecimal(20, piece.getTax1());
                pst.setBigDecimal(21, piece.getTax2());
                pst.setBigDecimal(22, piece.getTax3());
                pst.setBigDecimal(23, piece.getTax4());
                pst.setBigDecimal(24, piece.getTax5());
                pst.setString(25, piece.getBillReference());
                pst.setString(26, piece.getUpdateUserId());
                pst.setString(27, (new MEDate()).getDateTimeDB());
                pst.setBigDecimal(28, piece.getSendingId());
                pst.setBigDecimal(29, piece.getShippingTax());
                pst.setString(30, piece.getId());
                pst.setString(31, piece.getUpdateTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 25: // '\031'
                SalesBillPiece bill = (SalesBillPiece)obj;
                pst = con.prepareStatement("UPDATE ventes_factures SET id=?,prefixe=?,date=?,clients_id=?,commerciaux_id=?,contenu=?,net_a_payer=?,echeance=?,date_relance=?,montant_regle=?,mode_reglement=?,solde_le=?,entreprise_id=?,locking=?,total_brut_ht=?,commentaire=?,total_taxes=?,montant_tva1=?,montant_tva2=?,montant_tva3=?,montant_tva4=?,montant_tva5=?,total_sous_total=?,ventes=?,update_user_id=?,update_time=?,tva_port=? WHERE id=? AND update_time=?");
                pst.setString(1, bill.getId());
                pst.setString(2, bill.getPrefix());
                pst.setString(3, date.toMysql(bill.getDate()));
                pst.setString(4, bill.getCustomerId());
                pst.setInt(5, bill.getSalesPersonId().intValue());
                pst.setBigDecimal(6, bill.getShippingPrice());
                pst.setBigDecimal(7, bill.getNetPrice());
                pst.setString(8, date.toMysql(bill.getDueDate()));
                pst.setString(9, date.toMysql(bill.getReminderDate()));
                pst.setBigDecimal(10, bill.getPartPayment());
                pst.setString(11, bill.getMethodeOfPayment());
                pst.setString(12, date.toMysql(bill.getClearDate()));
                pst.setInt(13, bill.getCompagnyId().intValue());
                pst.setInt(14, bill.getLocking().intValue());
                pst.setBigDecimal(15, bill.getGrossPrice());
                pst.setString(16, bill.getNotes());
                pst.setBigDecimal(17, bill.getTotalTax());
                pst.setBigDecimal(18, bill.getTax1());
                pst.setBigDecimal(19, bill.getTax2());
                pst.setBigDecimal(20, bill.getTax3());
                pst.setBigDecimal(21, bill.getTax4());
                pst.setBigDecimal(22, bill.getTax5());
                pst.setBigDecimal(23, bill.getSubTotal());
                pst.setString(24, bill.getBillReference());
                pst.setString(25, bill.getUpdateUserId());
                pst.setString(26, (new MEDate()).getDateTimeDB());
                pst.setBigDecimal(27, bill.getShippingTax());
                pst.setString(28, bill.getId());
                pst.setString(29, bill.getUpdateTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 24: // '\030'
                BuysPiece buys = (BuysPiece)obj;
                pst = con.prepareStatement("UPDATE achats SET id=?,date=?,entreprise_id=?,locking=?,fournisseurs_id=?,commerciaux_id=?,no_fact=?,prefixe=?,contenu=?,net_a_payer=?,total_brut_ht=?,total_taxes=?,montant_tva1=?,montant_tva2=?,montant_tva3=?,montant_tva4=?,montant_tva5=?,montant_regle=?,mode_reglement=?,recu_le=?,solde_le=?,commentaire=?,update_user_id=?,update_time=?,tva_port=? WHERE id=? AND update_time=?");
                pst.setString(1, buys.getId());
                pst.setString(2, date.toMysql(buys.getDate()));
                pst.setInt(3, buys.getCompagnyId().intValue());
                pst.setInt(4, buys.getLocking().intValue());
                pst.setString(5, buys.getSupplierId());
                pst.setInt(6, buys.getSalesPersonId().intValue());
                pst.setString(7, buys.getBillReference());
                pst.setString(8, buys.getPrefix());
                pst.setBigDecimal(9, buys.getShippingPrice());
                pst.setBigDecimal(10, buys.getNetPrice());
                pst.setBigDecimal(11, buys.getGrossPrice());
                pst.setBigDecimal(12, buys.getTotalTax());
                pst.setBigDecimal(13, buys.getTax1());
                pst.setBigDecimal(14, buys.getTax2());
                pst.setBigDecimal(15, buys.getTax3());
                pst.setBigDecimal(16, buys.getTax4());
                pst.setBigDecimal(17, buys.getTax5());
                pst.setBigDecimal(18, buys.getPartPayment());
                pst.setString(19, buys.getMethodeOfPayment());
                pst.setString(20, date.toMysql(buys.getDeliveryDate()));
                pst.setString(21, date.toMysql(buys.getClearDate()));
                pst.setString(22, buys.getNotes());
                pst.setString(23, buys.getUpdateUserId());
                pst.setString(24, (new MEDate()).getDateTimeDB());
                pst.setBigDecimal(25, buys.getShippingTax());
                pst.setString(26, buys.getId());
                pst.setString(27, buys.getUpdateTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 27: // '\033'
                Customer customer = (Customer)obj;
                pst = con.prepareStatement("UPDATE clients SET id=?,id_gln=?,raison_sociale=?,adresse_fact=?,cp_fact=?,ville_fact=?,pays_fact=?,adresse_livr=?,cp_livr=?,ville_livr=?,pays_livr=?,mode_reglement=?,civilite=?,no_compte=?,commerciaux_id=?,contact=?,fonction_contact=?,telephone=?,portable=?,fax=?,email=?,site_web=?,familles_clients_id=?,remise=?,remise_excep=?,echeance_paiement=?,total_encaisse=?,cota_fidelite=?,commentaire=?,adresse2_fact=?,adresse2_livr=?,banque=?,update_user_id=?,update_time=?,photo1=?,photo2=? WHERE id=? AND update_time=?");
                pst.setString(1, customer.getId());
                pst.setString(2, customer.getIdGLN());
                pst.setString(3, customer.getRaisonSociale());
                pst.setString(4, customer.getAdresseFactUn());
                pst.setString(5, customer.getCpFact());
                pst.setString(6, customer.getVilleFact());
                pst.setString(7, customer.getPaysFact());
                pst.setString(8, customer.getAdresseLivrUn());
                pst.setString(9, customer.getCpLivr());
                pst.setString(10, customer.getVilleLivr());
                pst.setString(11, customer.getPaysLivr());
                pst.setString(12, customer.getModeReglement());
                pst.setString(13, customer.getCivilite());
                pst.setString(14, customer.getNumeroCompte());
                pst.setInt(15, customer.getCommerciauxId().intValue());
                pst.setString(16, customer.getNomPrenomContact());
                pst.setString(17, customer.getFonctionContact());
                pst.setString(18, customer.getTelephone());
                pst.setString(19, customer.getPortable());
                pst.setString(20, customer.getFax());
                pst.setString(21, customer.getEmail());
                pst.setString(22, customer.getSiteWeb());
                pst.setString(23, customer.getFamilleClientId());
                pst.setBigDecimal(24, customer.getRemise());
                pst.setBigDecimal(25, customer.getRemiseFidelite());
                pst.setInt(26, customer.getEcheancePaiement().intValue());
                pst.setBigDecimal(27, customer.getTotalEncaisser());
                pst.setBigDecimal(28, customer.getCotaFidelite());
                pst.setString(29, customer.getCommentaire());
                pst.setString(30, customer.getAdresseFactDeux());
                pst.setString(31, customer.getAdresseLivrDeux());
                pst.setString(32, customer.getBanque());
                pst.setString(33, customer.getUserId());
                pst.setString(34, (new MEDate()).getDateTimeDB());
                pst.setBytes(35, customer.getPhoto1());
                pst.setBytes(36, customer.getPhoto2());
                pst.setString(37, customer.getId());
                pst.setString(38, customer.getUpdateLastTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 9: // '\t'
                Supplier supplier = (Supplier)obj;
                pst = con.prepareStatement("UPDATE fournisseurs SET id=?,raison_sociale=?,adresse_com=?,cp_com=?,ville_com=?,pays_com=?,adresse_enlev=?,cp_enlev=?,ville_enlev=?,pays_enlev=?,civilite=?,no_compte=?,contact=?,fonction_contact=?,telephone=?,portable=?,fax=?,email=?,site_web=?,familles_fournisseurs_id=?,commentaire=?,adresse2_com=?,adresse2_enlev=?,update_user_id=?,update_time=?,gln=?,photo1=?,photo2=? WHERE id=? AND update_time=?");
                pst.setString(1, supplier.getId());
                pst.setString(2, supplier.getRaisonSociale());
                pst.setString(3, supplier.getAdresseComUn());
                pst.setString(4, supplier.getCpCom());
                pst.setString(5, supplier.getVilleCom());
                pst.setString(6, supplier.getPaysCom());
                pst.setString(7, supplier.getAdresseEnlevUn());
                pst.setString(8, supplier.getCpEnlev());
                pst.setString(9, supplier.getVilleEnlev());
                pst.setString(10, supplier.getPaysEnlev());
                pst.setString(11, supplier.getCivilite());
                pst.setString(12, supplier.getNumeroCompte());
                pst.setString(13, supplier.getNomPrenomContact());
                pst.setString(14, supplier.getFonctionContact());
                pst.setString(15, supplier.getTelephone());
                pst.setString(16, supplier.getPortable());
                pst.setString(17, supplier.getFax());
                pst.setString(18, supplier.getEmail());
                pst.setString(19, supplier.getSiteWeb());
                pst.setString(20, supplier.getFamilleFournisseurId());
                pst.setString(21, supplier.getCommentaire());
                pst.setString(22, supplier.getAdresseComDeux());
                pst.setString(23, supplier.getAdresseEnlevDeux());
                pst.setString(24, supplier.getUserId());
                pst.setString(25, (new MEDate()).getDateTimeDB());
                pst.setString(26, supplier.getGln());
                pst.setBytes(27, supplier.getPhoto1());
                pst.setBytes(28, supplier.getPhoto2());
                pst.setString(29, supplier.getId());
                pst.setString(30, supplier.getUpdateLastTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 11: // '\013'
                Item item = (Item)obj;
                pst = con.prepareStatement("UPDATE articles SET designation=?,familles_articles_id=?,ref_code_barre=?,price_list2=?,price_list3=?,price_list4=?,tva_id=?,fournisseurs_id=?,promotion=?,emplacement=?,web=?,prix_revient=?,price_list1=?,commentaire=?,alerte=?,unite_vente=?,update_user_id=?,update_time=?,date2=?,date3=?,date4=?,date=?,detail_revient=?,free1=?,free2=?,prix_achat_pondere=?,packaging=?,gtin=?,photo1=?,photo2=?,photo3=?,photo4=?,photo5=?,photo6=?,photo7=?,photo8=?,photo9=?,photo10=?,photos_valid=?,description=? WHERE ref_code_barre=? AND update_time=?");
                pst.setString(1, item.getDesignation());
                pst.setString(2, item.getFamillesArticlesId());
                pst.setString(3, item.getId());
                pst.setBigDecimal(4, item.getPriceList2());
                pst.setBigDecimal(5, item.getPriceList3());
                pst.setBigDecimal(6, item.getPriceList4());
                pst.setInt(7, item.getTvaId().intValue());
                pst.setString(8, item.getFournisseurId());
                pst.setBigDecimal(9, item.getPromotion());
                pst.setString(10, item.getEmplacement());
                pst.setString(11, item.getWeb());
                pst.setBigDecimal(12, item.getPrixRevient());
                pst.setBigDecimal(13, item.getPriceList1());
                pst.setString(14, item.getCommentaire());
                pst.setBigDecimal(15, item.getAlerte());
                pst.setString(16, item.getUniteVente());
                pst.setString(17, item.getUserId());
                pst.setString(18, (new MEDate()).getDateTimeDB());
                pst.setString(19, date.toMysql(item.getDate2()));
                pst.setString(20, date.toMysql(item.getDate3()));
                pst.setString(21, date.toMysql(item.getDate4()));
                pst.setString(22, date.toMysql(item.getDate()));
                pst.setString(23, item.getDetailRevient());
                pst.setString(24, item.getFree1());
                pst.setString(25, item.getFree2());
                pst.setBigDecimal(26, item.getPrixAchatPondere());
                pst.setInt(27, item.getPackaging().intValue());
                pst.setString(28, item.getGtin());
                pst.setBytes(29, item.getPhoto1());
                pst.setBytes(30, item.getPhoto2());
                pst.setBytes(31, item.getPhoto3());
                pst.setBytes(32, item.getPhoto4());
                pst.setBytes(33, item.getPhoto5());
                pst.setBytes(34, item.getPhoto6());
                pst.setBytes(35, item.getPhoto7());
                pst.setBytes(36, item.getPhoto8());
                pst.setBytes(37, item.getPhoto9());
                pst.setBytes(38, item.getPhoto10());
                pst.setString(39, item.getPhotosValid());
                pst.setString(40, item.getDescription());
                pst.setString(41, item.getId());
                pst.setString(42, item.getUpdateLastTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 26: // '\032'
                Payment payment = (Payment)obj;
                pst = con.prepareStatement("UPDATE reglements_clients SET id=?,prefix=?,piece_id=?,montant=?,mode=?,date=?,pointage=?,numero=?,update_user_id=?,update_time=? WHERE id=? AND update_time=?");
                pst.setInt(1, payment.getId().intValue());
                pst.setString(2, payment.getPrefix());
                pst.setString(3, payment.getPieceId());
                pst.setBigDecimal(4, payment.getMontant());
                pst.setString(5, payment.getMode());
                pst.setString(6, date.toMysql(payment.getDate()));
                pst.setString(7, payment.getPointage());
                pst.setString(8, payment.getNumero());
                pst.setString(9, payment.getUserId());
                pst.setString(10, (new MEDate()).getDateTimeDB());
                pst.setInt(11, payment.getId().intValue());
                pst.setString(12, payment.getUpdateLastTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 20: // '\024'
                Reminder reminder = (Reminder)obj;
                pst = con.prepareStatement("UPDATE reminder SET id=?,piece_id=?,date=?,status=?,notes=?,update_user_id=?,update_time=? WHERE id=? AND update_time=?");
                pst.setInt(1, reminder.getId().intValue());
                pst.setString(2, reminder.getPieceId());
                pst.setString(3, date.toMysql(reminder.getDate()));
                pst.setInt(4, reminder.getStatus().intValue());
                pst.setString(5, reminder.getNotes());
                pst.setString(6, reminder.getUserId());
                pst.setString(7, (new MEDate()).getDateTimeDB());
                pst.setInt(8, reminder.getId().intValue());
                pst.setString(9, reminder.getUpdateLastTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 15: // '\017'
                SalesPerson salesPerson = (SalesPerson)obj;
                pst = con.prepareStatement("UPDATE commerciaux SET id=?,nom=?,prenom=?,secteur=?,telephone=?,portable=?,fax=?,email=?,niveau=?,taux_vente=?,taux_total_vente=?,resultat=?,resultat_date=?,objectif=?,objectif_date=?,commentaire=?,update_user_id=?,update_time=?,sales_person_family_id=?,addr_ln1=?,addr_ln2=?,zip=?,city=?,country=? WHERE id=? AND update_time=?");
                pst.setInt(1, salesPerson.getId().intValue());
                pst.setString(2, salesPerson.getNom());
                pst.setString(3, salesPerson.getPrenom());
                pst.setString(4, salesPerson.getSecteur());
                pst.setString(5, salesPerson.getTelephone());
                pst.setString(6, salesPerson.getPortable());
                pst.setString(7, salesPerson.getFax());
                pst.setString(8, salesPerson.getEmail());
                pst.setString(9, salesPerson.getNiveau());
                pst.setBigDecimal(10, salesPerson.getTauxVente());
                pst.setBigDecimal(11, salesPerson.getTauxTotalVente());
                pst.setBigDecimal(12, salesPerson.getResultat());
                pst.setString(13, date.toMysql(salesPerson.getResultatDate()));
                pst.setBigDecimal(14, salesPerson.getObjectif());
                pst.setString(15, date.toMysql(salesPerson.getObjectifDate()));
                pst.setString(16, salesPerson.getCommentaire());
                pst.setString(17, salesPerson.getUserId());
                pst.setString(18, (new MEDate()).getDateTimeDB());
                pst.setString(19, salesPerson.getSalesPersonFamily());
                pst.setString(20, salesPerson.getAddrLn1());
                pst.setString(21, salesPerson.getAddrLn2());
                pst.setString(22, salesPerson.getZip());
                pst.setString(23, salesPerson.getCity());
                pst.setString(24, salesPerson.getCountry());
                pst.setInt(25, salesPerson.getId().intValue());
                pst.setString(26, salesPerson.getUpdateLastTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 21: // '\025'
                Agency agency = (Agency)obj;
                pst = con.prepareStatement("UPDATE entreprise SET id=?,raison_sociale=?,civilite=?,adresse=?,cp=?,ville=?,pays=?,telephone=?,fax=?,email=?,siret=?,naf=?,site_web=?,adresse2=?,telephone_deux=?,telephone_trois=?,fax_deux=?,fax_trois=?,update_user_id=?,update_time=?,gln=?,photo1=?,photo2=?,notes=? WHERE id=? AND update_time=?");
                pst.setInt(1, agency.getId().intValue());
                pst.setString(2, agency.getRaisonSociale());
                pst.setString(3, agency.getCivilite());
                pst.setString(4, agency.getAdresseUn());
                pst.setString(5, agency.getCp());
                pst.setString(6, agency.getVille());
                pst.setString(7, agency.getPays());
                pst.setString(8, agency.getTelephoneUn());
                pst.setString(9, agency.getFaxUn());
                pst.setString(10, agency.getEmail());
                pst.setString(11, agency.getSiret());
                pst.setString(12, agency.getNaf());
                pst.setString(13, agency.getSiteWeb());
                pst.setString(14, agency.getAdresseDeux());
                pst.setString(15, agency.getTelephoneDeux());
                pst.setString(16, agency.getTelephoneTrois());
                pst.setString(17, agency.getFaxDeux());
                pst.setString(18, agency.getFaxTrois());
                pst.setString(19, agency.getUserId());
                pst.setString(20, (new MEDate()).getDateTimeDB());
                pst.setString(21, agency.getGln());
                pst.setBytes(22, agency.getPhoto1());
                pst.setBytes(23, agency.getPhoto2());
                pst.setString(24, agency.getNotes());
                pst.setInt(25, agency.getId().intValue());
                pst.setString(26, agency.getUpdateLastTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 28: // '\034'
                OrderRow row = (OrderRow)obj;
                pst = con.prepareStatement("UPDATE contenu SET id=?,line=?,status=?,facture_id=?,vente_id=?,article_id=?,designation=?,tva_id=?,lot_id=?,reliquat_id=?,quantite=?,prix_vente=?,prix_unitaire=?,total_ht=?,remise=?,update_user_id=?,update_time=?,batch_id=? WHERE id=? AND update_time=?");
                pst.setInt(1, row.getId().intValue());
                pst.setInt(2, row.getLine().intValue());
                pst.setBigDecimal(3, row.getStatus());
                pst.setString(4, row.getFactureId());
                pst.setString(5, row.getVenteId());
                pst.setString(6, row.getArticleId());
                pst.setString(7, row.getDesignation());
                pst.setInt(8, row.getTvaId().intValue());
                pst.setString(9, row.getLotId());
                pst.setInt(10, row.getReliquatId().intValue());
                pst.setBigDecimal(11, row.getQuantite());
                pst.setBigDecimal(12, row.getPrixVente());
                pst.setBigDecimal(13, row.getPrixUnitaire());
                pst.setBigDecimal(14, row.getTotalHt());
                pst.setBigDecimal(15, row.getRemise());
                pst.setString(16, row.getUserId());
                pst.setString(17, (new MEDate()).getDateTimeDB());
                pst.setInt(18, row.getBatchId().intValue());
                pst.setInt(19, row.getId().intValue());
                pst.setString(20, row.getUpdateLastTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 30: // '\036'
                OrderRow rowB = (OrderRow)obj;
                pst = con.prepareStatement("UPDATE contenu_a SET id=?,line=?,status=?,facture_id=?,vente_id=?,article_id=?,designation=?,tva_id=?,lot_id=?,reliquat_id=?,quantite=?,prix_vente=?,prix_unitaire=?,total_ht=?,remise=?,update_user_id=?,update_time=?,batch_id=? WHERE id=? AND update_time=?");
                pst.setInt(1, rowB.getId().intValue());
                pst.setInt(2, rowB.getLine().intValue());
                pst.setBigDecimal(3, rowB.getStatus());
                pst.setString(4, rowB.getFactureId());
                pst.setString(5, rowB.getVenteId());
                pst.setString(6, rowB.getArticleId());
                pst.setString(7, rowB.getDesignation());
                pst.setInt(8, rowB.getTvaId().intValue());
                pst.setString(9, rowB.getLotId());
                pst.setInt(10, rowB.getReliquatId().intValue());
                pst.setBigDecimal(11, rowB.getQuantite());
                pst.setBigDecimal(12, rowB.getPrixVente());
                pst.setBigDecimal(13, rowB.getPrixUnitaire());
                pst.setBigDecimal(14, rowB.getTotalHt());
                pst.setBigDecimal(15, rowB.getRemise());
                pst.setString(16, rowB.getUserId());
                pst.setString(17, (new MEDate()).getDateTimeDB());
                pst.setInt(18, rowB.getBatchId().intValue());
                pst.setInt(19, rowB.getId().intValue());
                pst.setString(20, rowB.getUpdateLastTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 18: // '\022'
                Tax tax = (Tax)obj;
                pst = con.prepareStatement("UPDATE tva SET id=?,taux=?,update_user_id=?,update_time=? WHERE id=? AND update_time=?");
                pst.setInt(1, tax.getId().intValue());
                pst.setBigDecimal(2, tax.getTaux());
                pst.setString(3, tax.getUserId());
                pst.setString(4, (new MEDate()).getDateTimeDB());
                pst.setInt(5, tax.getId().intValue());
                pst.setString(6, tax.getUpdateLastTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 31: // '\037'
                Batch batch = (Batch)obj;
                pst = con.prepareStatement("UPDATE batch SET id=?,buy_id=?,sscc=?,trucking_company=?,pallet_gtin=?,box_gtin=?,item_gtin=?,item_id=?,item_batch=?,delivery_form=?,supplier_gln=?,supplier_id=?,agency_id=?,input_stock_date=?,inventory_date=?,dlc=?,dluo=?,input_stock_quantity=?,stock_quantity=?,delta_inventory=?,packaging=?,unit=?,batch_price=?,status=?,notes=?,update_user_id=?,update_time=? WHERE id=? AND update_time=?");
                pst.setInt(1, batch.getId().intValue());
                pst.setString(2, batch.getBuyId());
                pst.setString(3, batch.getSscc());
                pst.setString(4, batch.getTruckingCompagny());
                pst.setString(5, batch.getPalletGTIN());
                pst.setString(6, batch.getBoxGTIN());
                pst.setString(7, batch.getItemGTIN());
                pst.setString(8, batch.getItemId());
                pst.setString(9, batch.getItemBatch());
                pst.setString(10, batch.getDeliveryForm());
                pst.setString(11, batch.getSupplierGLN());
                pst.setString(12, batch.getSupplierId());
                pst.setInt(13, batch.getAgencyId().intValue());
                pst.setString(14, date.toMysql(batch.getInputStockDate()));
                pst.setString(15, date.toMysql(batch.getInventoryDate()));
                pst.setString(16, date.toMysql(batch.getDateDLC()));
                pst.setString(17, date.toMysql(batch.getDateDLUO()));
                pst.setBigDecimal(18, batch.getInputStockQuantity());
                pst.setBigDecimal(19, batch.getStockQuantity());
                pst.setBigDecimal(20, batch.getDeltaInventory());
                pst.setBigDecimal(21, batch.getPackaging());
                pst.setString(22, batch.getUnit());
                pst.setBigDecimal(23, batch.getBatchPrice());
                pst.setInt(24, batch.getStatus().intValue());
                pst.setString(25, batch.getNotes());
                pst.setString(26, batch.getUserId());
                pst.setString(27, (new MEDate()).getDateTimeDB());
                pst.setInt(28, batch.getId().intValue());
                pst.setString(29, batch.getUpdateLastTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 32: // ' '
                LogStock logStock = (LogStock)obj;
                pst = con.prepareStatement("UPDATE journal_stock SET id=?,operation=?,de=?,vers=?,quantite=?,date=?,update_user_id=?,update_time=?,articles_id=?,no_lot=?,commentaire=? WHERE id=? AND update_time=?");
                pst.setInt(1, logStock.getId().intValue());
                pst.setString(2, logStock.getOperation());
                pst.setString(3, logStock.getDe());
                pst.setString(4, logStock.getVers());
                pst.setBigDecimal(5, logStock.getQuantity());
                pst.setString(6, date.toMysql(logStock.getDate()));
                pst.setString(7, logStock.getUserId());
                pst.setString(8, (new MEDate()).getDateTimeDB());
                pst.setString(9, logStock.getItemId());
                pst.setString(10, logStock.getBatchId().toString());
                pst.setString(11, logStock.getNotes());
                pst.setInt(12, logStock.getId().intValue());
                pst.setString(13, logStock.getUpdateLastTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 33: // '!'
                Sending sending = (Sending)obj;
                pst = con.prepareStatement("UPDATE sending SET id=?,order_id=?,sscc=?,trucking_company=?,pallet_gtin=?,box_gtin=?,delivery_form=?,supplier_gln=?,supplier_id=?,agency_id=?,sending_date=?,preparation_date=?,delivery_anticipated_date=?,delivery_date=?,weight=?,parcel_quantity=?,packaging=?,unit=?,insurance_value=?,insurance_company=?,status=?,notes=?,update_user_id=?,update_time=? WHERE id=? AND update_time=?");
                pst.setInt(1, sending.getId().intValue());
                pst.setString(2, sending.getOrderId());
                pst.setString(3, sending.getSscc());
                pst.setString(4, sending.getTruckingCompagny());
                pst.setString(5, sending.getPalletGTIN());
                pst.setString(6, sending.getBoxGTIN());
                pst.setString(7, sending.getDeliveryForm());
                pst.setString(8, sending.getCustomerGLN());
                pst.setString(9, sending.getCustomerId());
                pst.setInt(10, sending.getAgencyId().intValue());
                pst.setString(11, date.toMysql(sending.getSendingDate()));
                pst.setString(12, date.toMysql(sending.getPreparationDate()));
                pst.setString(13, date.toMysql(sending.getDeliveryAnticipatedDate()));
                pst.setString(14, date.toMysql(sending.getDeliveryDate()));
                pst.setBigDecimal(15, sending.getWeight());
                pst.setBigDecimal(16, sending.getParcelQuantity());
                pst.setBigDecimal(17, sending.getPackaging());
                pst.setString(18, sending.getUnit());
                pst.setBigDecimal(19, sending.getInsuranceValue());
                pst.setString(20, sending.getInsuranceCompany());
                pst.setInt(21, sending.getStatus().intValue());
                pst.setString(22, sending.getNotes());
                pst.setString(23, sending.getUserId());
                pst.setString(24, (new MEDate()).getDateTimeDB());
                pst.setInt(25, sending.getId().intValue());
                pst.setString(26, sending.getUpdateLastTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 34: // '"'
                Number buyNumber = (Number)obj;
                pst = con.prepareStatement("UPDATE numero_achat SET id=?,time=? WHERE id=?");
                pst.setInt(1, buyNumber.getId().intValue());
                pst.setString(2, buyNumber.getTime());
                pst.setInt(3, buyNumber.getId().intValue());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 35: // '#'
                Number sendingNumber = (Number)obj;
                pst = con.prepareStatement("UPDATE numero_expedition SET id=?,time=? WHERE id=?");
                pst.setInt(1, sendingNumber.getId().intValue());
                pst.setString(2, sendingNumber.getTime());
                pst.setInt(3, sendingNumber.getId().intValue());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 36: // '$'
                Number salesBillNumber = (Number)obj;
                pst = con.prepareStatement("UPDATE numero_facture SET id=?,time=? WHERE id=?");
                pst.setInt(1, salesBillNumber.getId().intValue());
                pst.setString(2, salesBillNumber.getTime());
                pst.setInt(3, salesBillNumber.getId().intValue());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 37: // '%'
                Number batchNumber = (Number)obj;
                pst = con.prepareStatement("UPDATE numero_lot SET id=?,time=? WHERE id=?");
                pst.setInt(1, batchNumber.getId().intValue());
                pst.setString(2, batchNumber.getTime());
                pst.setInt(3, batchNumber.getId().intValue());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 38: // '&'
                Number salesNumber = (Number)obj;
                pst = con.prepareStatement("UPDATE numero_vente SET id=?,time=? WHERE id=?");
                pst.setInt(1, salesNumber.getId().intValue());
                pst.setString(2, salesNumber.getTime());
                pst.setInt(3, salesNumber.getId().intValue());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 12: // '\f'
                Family itemFamily = (Family)obj;
                pst = con.prepareStatement("UPDATE familles_articles SET id=?,designation=?,coefficient=?,update_user_id=?,update_time=? WHERE id=? AND update_time=?");
                pst.setString(1, itemFamily.getId());
                pst.setString(2, itemFamily.getDesignation());
                pst.setBigDecimal(3, itemFamily.getCoefficient());
                pst.setString(4, itemFamily.getUpdateUserId());
                pst.setString(5, (new MEDate()).getDateTimeDB());
                pst.setString(6, itemFamily.getId());
                pst.setString(7, itemFamily.getUpdateTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 46: // '.'
                Family customerFamily = (Family)obj;
                pst = con.prepareStatement("UPDATE familles_clients SET id=?,designation=?,coefficient=?,update_user_id=?,update_time=? WHERE id=? AND update_time=?");
                pst.setString(1, customerFamily.getId());
                pst.setString(2, customerFamily.getDesignation());
                pst.setBigDecimal(3, customerFamily.getCoefficient());
                pst.setString(4, customerFamily.getUpdateUserId());
                pst.setString(5, (new MEDate()).getDateTimeDB());
                pst.setString(6, customerFamily.getId());
                pst.setString(7, customerFamily.getUpdateTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 10: // '\n'
                Family supplierFamily = (Family)obj;
                pst = con.prepareStatement("UPDATE familles_fournisseurs SET id=?,designation=?,coefficient=?,update_user_id=?,update_time=? WHERE id=? AND update_time=?");
                pst.setString(1, supplierFamily.getId());
                pst.setString(2, supplierFamily.getDesignation());
                pst.setBigDecimal(3, supplierFamily.getCoefficient());
                pst.setString(4, supplierFamily.getUpdateUserId());
                pst.setString(5, (new MEDate()).getDateTimeDB());
                pst.setString(6, supplierFamily.getId());
                pst.setString(7, supplierFamily.getUpdateTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 39: // '\''
                Family salesPersonFamily = (Family)obj;
                pst = con.prepareStatement("UPDATE sales_person_family SET id=?,designation=?,coefficient=?,update_user_id=?,update_time=? WHERE id=? AND update_time=?");
                pst.setString(1, salesPersonFamily.getId());
                pst.setString(2, salesPersonFamily.getDesignation());
                pst.setBigDecimal(3, salesPersonFamily.getCoefficient());
                pst.setString(4, salesPersonFamily.getUpdateUserId());
                pst.setString(5, (new MEDate()).getDateTimeDB());
                pst.setString(6, salesPersonFamily.getId());
                pst.setString(7, salesPersonFamily.getUpdateTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 40: // '('
                DetailsList detailsList = (DetailsList)obj;
                pst = con.prepareStatement("UPDATE detail_list SET id=?,name=?,category=?,update_user_id=?,update_time=? WHERE id=? AND update_time=?");
                pst.setInt(1, detailsList.getId().intValue());
                pst.setString(2, detailsList.getName());
                pst.setString(3, detailsList.getCategory());
                pst.setString(4, detailsList.getUpdateUserId());
                pst.setString(5, (new MEDate()).getDateTimeDB());
                pst.setInt(6, detailsList.getId().intValue());
                pst.setString(7, detailsList.getUpdateTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 41: // ')'
                Details itemDetails = (Details)obj;
                pst = con.prepareStatement("UPDATE detail_articles SET id=?,detail_list_id=?,value=?,notes=?,image=?,parent_id=?,update_user_id=?,update_time=? WHERE id=? AND update_time=?");
                pst.setInt(1, itemDetails.getId().intValue());
                pst.setInt(2, itemDetails.getDetailListId().intValue());
                pst.setString(3, itemDetails.getValue());
                pst.setString(4, itemDetails.getNotes());
                pst.setBytes(5, itemDetails.getImage());
                pst.setString(6, (String)itemDetails.getParentId());
                pst.setString(7, itemDetails.getUpdateUserId());
                pst.setString(8, (new MEDate()).getDateTimeDB());
                pst.setInt(9, itemDetails.getId().intValue());
                pst.setString(10, itemDetails.getUpdateTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 42: // '*'
                Details customerDetails = (Details)obj;
                pst = con.prepareStatement("UPDATE detail_clients SET id=?,detail_list_id=?,value=?,notes=?,image=?,parent_id=?,update_user_id=?,update_time=? WHERE id=? AND update_time=?");
                pst.setInt(1, customerDetails.getId().intValue());
                pst.setInt(2, customerDetails.getDetailListId().intValue());
                pst.setString(3, customerDetails.getValue());
                pst.setString(4, customerDetails.getNotes());
                pst.setBytes(5, customerDetails.getImage());
                pst.setString(6, (String)customerDetails.getParentId());
                pst.setString(7, customerDetails.getUpdateUserId());
                pst.setString(8, (new MEDate()).getDateTimeDB());
                pst.setInt(9, customerDetails.getId().intValue());
                pst.setString(10, customerDetails.getUpdateTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 44: // ','
                Details salesPersonDetails = (Details)obj;
                pst = con.prepareStatement("UPDATE detail_commerciaux SET id=?,detail_list_id=?,value=?,notes=?,image=?,parent_id=?,update_user_id=?,update_time=? WHERE id=? AND update_time=?");
                pst.setInt(1, salesPersonDetails.getId().intValue());
                pst.setInt(2, salesPersonDetails.getDetailListId().intValue());
                pst.setString(3, salesPersonDetails.getValue());
                pst.setString(4, salesPersonDetails.getNotes());
                pst.setBytes(5, salesPersonDetails.getImage());
                pst.setInt(6, ((Integer)salesPersonDetails.getParentId()).intValue());
                pst.setString(7, salesPersonDetails.getUpdateUserId());
                pst.setString(8, (new MEDate()).getDateTimeDB());
                pst.setInt(9, salesPersonDetails.getId().intValue());
                pst.setString(10, salesPersonDetails.getUpdateTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 45: // '-'
                Details agencyDetails = (Details)obj;
                pst = con.prepareStatement("UPDATE detail_entreprise SET id=?,detail_list_id=?,value=?,notes=?,image=?,parent_id=?,update_user_id=?,update_time=? WHERE id=? AND update_time=?");
                pst.setInt(1, agencyDetails.getId().intValue());
                pst.setInt(2, agencyDetails.getDetailListId().intValue());
                pst.setString(3, agencyDetails.getValue());
                pst.setString(4, agencyDetails.getNotes());
                pst.setBytes(5, agencyDetails.getImage());
                pst.setInt(6, ((Integer)agencyDetails.getParentId()).intValue());
                pst.setString(7, agencyDetails.getUpdateUserId());
                pst.setString(8, (new MEDate()).getDateTimeDB());
                pst.setInt(9, agencyDetails.getId().intValue());
                pst.setString(10, agencyDetails.getUpdateTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 43: // '+'
                Details supplierDetails = (Details)obj;
                pst = con.prepareStatement("UPDATE detail_fournisseurs SET id=?,detail_list_id=?,value=?,notes=?,image=?,parent_id=?,update_user_id=?,update_time=? WHERE id=? AND update_time=?");
                pst.setInt(1, supplierDetails.getId().intValue());
                pst.setInt(2, supplierDetails.getDetailListId().intValue());
                pst.setString(3, supplierDetails.getValue());
                pst.setString(4, supplierDetails.getNotes());
                pst.setBytes(5, supplierDetails.getImage());
                pst.setString(6, (String)supplierDetails.getParentId());
                pst.setString(7, supplierDetails.getUpdateUserId());
                pst.setString(8, (new MEDate()).getDateTimeDB());
                pst.setInt(9, supplierDetails.getId().intValue());
                pst.setString(10, supplierDetails.getUpdateTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 47: // '/'
                Details userDetails = (Details)obj;
                pst = con.prepareStatement("UPDATE detail_utilisateurs SET id=?,detail_list_id=?,value=?,notes=?,image=?,parent_id=?,update_user_id=?,update_time=? WHERE id=? AND update_time=?");
                pst.setInt(1, userDetails.getId().intValue());
                pst.setInt(2, userDetails.getDetailListId().intValue());
                pst.setString(3, userDetails.getValue());
                pst.setString(4, userDetails.getNotes());
                pst.setBytes(5, userDetails.getImage());
                pst.setString(6, (String)userDetails.getParentId());
                pst.setString(7, userDetails.getUpdateUserId());
                pst.setString(8, (new MEDate()).getDateTimeDB());
                pst.setInt(9, userDetails.getId().intValue());
                pst.setString(10, userDetails.getUpdateTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 19: // '\023'
                User user = (User)obj;
                pst = con.prepareStatement("UPDATE utilisateurs SET id=?,password=?,nom=?,prenom=?,droits=?,groups=?,adrln1=?,adrln2=?,ville=?,cp=?,tel1=?,tel2=?,fax=?,email=?,job=?,notes=?,msg=?,nb_connection=?,expiry_date=?,update_user_id=?,update_time=?,photo1=?,photo2=? WHERE id=? AND update_time=?");
                pst.setString(1, user.getId());
                pst.setString(2, user.getPassword());
                pst.setString(3, user.getLastname());
                pst.setString(4, user.getFirstname());
                pst.setInt(5, user.getLaw().intValue());
                pst.setString(6, user.getGroup());
                pst.setString(7, user.getAddrLn1());
                pst.setString(8, user.getAddrLn2());
                pst.setString(9, user.getCity());
                pst.setString(10, user.getZip());
                pst.setString(11, user.getTel1());
                pst.setString(12, user.getTel2());
                pst.setString(13, user.getFax());
                pst.setString(14, user.getEmail());
                pst.setString(15, user.getJob());
                pst.setString(16, user.getNotes());
                pst.setString(17, user.getMsg());
                pst.setInt(18, user.getNumConsult().intValue());
                pst.setString(19, date.toMysql(user.getExpiryDate()));
                pst.setString(20, user.getUserId());
                pst.setString(21, (new MEDate()).getDateTimeDB());
                pst.setBytes(22, user.getPhoto1());
                pst.setBytes(23, user.getPhoto2());
                pst.setString(24, user.getId());
                pst.setString(25, user.getUpdateLastTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 48: // '0'
                Discount discount = (Discount)obj;
                pst = con.prepareStatement("UPDATE remise_par_client SET id=?,clients_id=?,articles_id=?,remise=?,qt_un=?,qt_deux=?,qt_trois=?,remise_qt_un=?,remise_qt_deux=?,remise_qt_trois=?,update_user_id=?,update_time=? WHERE id=? AND update_time=?");
                pst.setInt(1, discount.getId().intValue());
                pst.setString(2, discount.getClientId());
                pst.setString(3, discount.getArticleId());
                pst.setBigDecimal(4, discount.getRemise());
                pst.setBigDecimal(5, discount.getQtUn());
                pst.setBigDecimal(6, discount.getQtDeux());
                pst.setBigDecimal(7, discount.getQtTrois());
                pst.setBigDecimal(8, discount.getRemiseQtUn());
                pst.setBigDecimal(9, discount.getRemiseQtDeux());
                pst.setBigDecimal(10, discount.getRemiseQtTrois());
                pst.setString(11, discount.getUpdateUserId());
                pst.setString(12, (new MEDate()).getDateTimeDB());
                pst.setInt(13, discount.getId().intValue());
                pst.setString(14, discount.getUpdateTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 49: // '1'
                Discount d = (Discount)obj;
                pst = con.prepareStatement("UPDATE remise_famart_par_client SET id=?,clients_id=?,familles_articles_id=?,remise=?,qt_un=?,qt_deux=?,qt_trois=?,remise_qt_un=?,remise_qt_deux=?,remise_qt_trois=?,update_user_id=?,update_time=? WHERE id=? AND update_time=?");
                pst.setInt(1, d.getId().intValue());
                pst.setString(2, d.getClientId());
                pst.setString(3, d.getArticleId());
                pst.setBigDecimal(4, d.getRemise());
                pst.setBigDecimal(5, d.getQtUn());
                pst.setBigDecimal(6, d.getQtDeux());
                pst.setBigDecimal(7, d.getQtTrois());
                pst.setBigDecimal(8, d.getRemiseQtUn());
                pst.setBigDecimal(9, d.getRemiseQtDeux());
                pst.setBigDecimal(10, d.getRemiseQtTrois());
                pst.setString(11, d.getUpdateUserId());
                pst.setString(12, (new MEDate()).getDateTimeDB());
                pst.setInt(13, d.getId().intValue());
                pst.setString(14, d.getUpdateTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 16: // '\020'
                Commission itemCommission = (Commission)obj;
                pst = con.prepareStatement("UPDATE comm_par_article SET id=?,commerciaux_id=?,articles_id=?,debut=?,fin=?,t=?,update_user_id=?,update_time=? WHERE id=? AND update_time=?");
                pst.setInt(1, itemCommission.getId().intValue());
                pst.setInt(2, itemCommission.getCommerciauxId().intValue());
                pst.setString(3, itemCommission.getArticleId());
                pst.setString(4, date.toMysql(itemCommission.getDebut()));
                pst.setString(5, date.toMysql(itemCommission.getFin()));
                pst.setBigDecimal(6, itemCommission.getT());
                pst.setString(7, itemCommission.getUpdateUserId());
                pst.setString(8, (new MEDate()).getDateTimeDB());
                pst.setInt(9, itemCommission.getId().intValue());
                pst.setString(10, itemCommission.getUpdateTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 50: // '2'
                Commission itemFamilyCommission = (Commission)obj;
                pst = con.prepareStatement("UPDATE comm_par_famille SET id=?,commerciaux_id=?,famille_articles_id=?,debut=?,fin=?,t=?,update_user_id=?,update_time=? WHERE id=? AND update_time=?");
                pst.setInt(1, itemFamilyCommission.getId().intValue());
                pst.setInt(2, itemFamilyCommission.getCommerciauxId().intValue());
                pst.setString(3, itemFamilyCommission.getArticleId());
                pst.setString(4, date.toMysql(itemFamilyCommission.getDebut()));
                pst.setString(5, date.toMysql(itemFamilyCommission.getFin()));
                pst.setBigDecimal(6, itemFamilyCommission.getT());
                pst.setString(7, itemFamilyCommission.getUpdateUserId());
                pst.setString(8, (new MEDate()).getDateTimeDB());
                pst.setInt(9, itemFamilyCommission.getId().intValue());
                pst.setString(10, itemFamilyCommission.getUpdateTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 51: // '3'
                Db db = (Db)obj;
                pst = con.prepareStatement("UPDATE db SET id=?,name=?,dbname=?,login=?,password=?,url=?,admin_login=?,admin_password=?,admin_url=?,notes=?,update_user_id=?,update_time=?,date=? WHERE id=? AND update_time=?");
                pst.setInt(1, db.getId().intValue());
                pst.setString(2, db.getName());
                pst.setString(3, db.getDbname());
                pst.setString(4, db.getLogin());
                pst.setString(5, db.getPassword());
                pst.setString(6, db.getUrl());
                pst.setString(7, db.getAdminLogin());
                pst.setString(8, db.getAdminPassword());
                pst.setString(9, db.getAdminUrl());
                pst.setString(10, db.getNotes());
                pst.setString(11, db.getUpdateLastUserId());
                pst.setString(12, (new MEDate()).getDateTimeDB());
                pst.setString(13, date.toMysql(db.getDate()));
                pst.setInt(14, db.getId().intValue());
                pst.setString(15, db.getUpdateLastTime());
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 13: // '\r'
            case 14: // '\016'
            case 17: // '\021'
            case 23: // '\027'
            case 29: // '\035'
            default:
                return false;
            }
        }
        catch(SQLException e)
        {
            e.printStackTrace();
        }
        return false;
    }

    private boolean updateSQL(Object obj0, Object obj1, int type)
    {
        try
        {
            switch(type)
            {
            case 27: // '\033'
                String oldCustomerFamily = (String)obj0;
                String newCustomerFamily = (String)obj1;
                pst = con.prepareStatement("UPDATE clients SET familles_clients_id=? WHERE familles_clients_id=?");
                pst.setString(1, newCustomerFamily);
                pst.setString(2, oldCustomerFamily);
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 9: // '\t'
                String oldSupplierFamily = (String)obj0;
                String newSupplierFamily = (String)obj1;
                pst = con.prepareStatement("UPDATE fournisseurs SET familles_fournisseurs_id=? WHERE familles_fournisseurs_id=?");
                pst.setString(1, newSupplierFamily);
                pst.setString(2, oldSupplierFamily);
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 11: // '\013'
                String oldItemFamily = (String)obj0;
                String newItemFamily = (String)obj1;
                pst = con.prepareStatement("UPDATE articles SET familles_articles_id=? WHERE familles_articles_id=?");
                pst.setString(1, newItemFamily);
                pst.setString(2, oldItemFamily);
                pst.execute();
                return pst.getUpdateCount() != 0;

            case 15: // '\017'
                String oldSalesPersonFamily = (String)obj0;
                String newSalesPersonFamily = (String)obj1;
                pst = con.prepareStatement("UPDATE commerciaux SET sales_person_family_id=? WHERE sales_person_family_id=?");
                pst.setString(1, newSalesPersonFamily);
                pst.setString(2, oldSalesPersonFamily);
                pst.execute();
                return pst.getUpdateCount() != 0;
            }
            return false;
        }
        catch(SQLException e)
        {
            e.printStackTrace();
        }
        return false;
    }

    private boolean deleteSQL(Object pk, String lastUpdate, int type)
    {
        try
        {
            switch(type)
            {
            case 22: // '\026'
                pst = con.prepareStatement("DELETE FROM ventes WHERE id=? AND update_time=?");
                pst.setString(1, (String)pk);
                pst.setString(2, lastUpdate);
                pst.execute();
                return cascadeDelete(pk, type);

            case 25: // '\031'
                pst = con.prepareStatement("DELETE FROM ventes_factures WHERE id=? AND update_time=?");
                pst.setString(1, (String)pk);
                pst.setString(2, lastUpdate);
                pst.execute();
                return cascadeDelete(pk, type);

            case 24: // '\030'
                pst = con.prepareStatement("DELETE FROM achats WHERE id=? AND update_time=?");
                pst.setString(1, (String)pk);
                pst.setString(2, lastUpdate);
                pst.execute();
                return cascadeDelete(pk, type);

            case 27: // '\033'
                pst = con.prepareStatement("DELETE FROM clients WHERE id=? AND update_time=?");
                pst.setString(1, (String)pk);
                pst.setString(2, lastUpdate);
                pst.execute();
                return cascadeDelete(pk, type);

            case 9: // '\t'
                pst = con.prepareStatement("DELETE FROM fournisseurs WHERE id=? AND update_time=?");
                pst.setString(1, (String)pk);
                pst.setString(2, lastUpdate);
                pst.execute();
                return true;

            case 11: // '\013'
                pst = con.prepareStatement("DELETE FROM articles WHERE ref_code_barre=? AND update_time=?");
                pst.setString(1, (String)pk);
                pst.setString(2, lastUpdate);
                pst.execute();
                return true;

            case 26: // '\032'
                pst = con.prepareStatement("DELETE FROM reglements_clients WHERE id=? AND update_time=?");
                Integer idPayment = (Integer)pk;
                pst.setInt(1, idPayment.intValue());
                pst.setString(2, lastUpdate);
                pst.execute();
                return true;

            case 20: // '\024'
                pst = con.prepareStatement("DELETE FROM reminder WHERE id=? AND update_time=?");
                Integer idReminder = (Integer)pk;
                pst.setInt(1, idReminder.intValue());
                pst.setString(2, lastUpdate);
                pst.execute();
                return true;

            case 15: // '\017'
                pst = con.prepareStatement("DELETE FROM commerciaux WHERE id=? AND update_time=?");
                Integer idSalesPerson = (Integer)pk;
                pst.setInt(1, idSalesPerson.intValue());
                pst.setString(2, lastUpdate);
                pst.execute();
                return true;

            case 21: // '\025'
                pst = con.prepareStatement("DELETE FROM entreprise WHERE id=? AND update_time=?");
                Integer idAgency = (Integer)pk;
                pst.setInt(1, idAgency.intValue());
                pst.setString(2, lastUpdate);
                pst.execute();
                return true;

            case 28: // '\034'
                pst = con.prepareStatement("DELETE FROM contenu WHERE id=? AND update_time=?");
                Integer idSalesRow = (Integer)pk;
                pst.setInt(1, idSalesRow.intValue());
                pst.setString(2, lastUpdate);
                pst.execute();
                return true;

            case 30: // '\036'
                pst = con.prepareStatement("DELETE FROM contenu_a WHERE id=? AND update_time=?");
                Integer idBuysRow = (Integer)pk;
                pst.setInt(1, idBuysRow.intValue());
                pst.setString(2, lastUpdate);
                pst.execute();
                return true;

            case 18: // '\022'
                pst = con.prepareStatement("DELETE FROM tva WHERE id=? AND update_time=?");
                Integer idTax = (Integer)pk;
                pst.setInt(1, idTax.intValue());
                pst.setString(2, lastUpdate);
                pst.execute();
                return true;

            case 31: // '\037'
                pst = con.prepareStatement("DELETE FROM batch WHERE id=? AND update_time=?");
                Integer idBatch = (Integer)pk;
                pst.setInt(1, idBatch.intValue());
                pst.setString(2, lastUpdate);
                pst.execute();
                return true;

            case 32: // ' '
                pst = con.prepareStatement("DELETE FROM journal_stock WHERE id=? AND update_time=?");
                Integer idLogStock = (Integer)pk;
                pst.setInt(1, idLogStock.intValue());
                pst.setString(2, lastUpdate);
                pst.execute();
                return true;

            case 33: // '!'
                pst = con.prepareStatement("DELETE FROM sending WHERE id=? AND update_time=?");
                Integer idSending = (Integer)pk;
                pst.setInt(1, idSending.intValue());
                pst.setString(2, lastUpdate);
                pst.execute();
                return true;

            case 34: // '"'
                pst = con.prepareStatement("DELETE FROM numero_achat");
                pst.execute();
                return true;

            case 35: // '#'
                pst = con.prepareStatement("DELETE FROM numero_expedition");
                pst.execute();
                return true;

            case 36: // '$'
                pst = con.prepareStatement("DELETE FROM numero_facture");
                pst.execute();
                return true;

            case 37: // '%'
                pst = con.prepareStatement("DELETE FROM numero_lot");
                pst.execute();
                return true;

            case 38: // '&'
                pst = con.prepareStatement("DELETE FROM numero_vente");
                pst.execute();
                return true;

            case 12: // '\f'
                pst = con.prepareStatement("DELETE FROM familles_articles WHERE id=? AND update_time=?");
                String idItemFamily = (String)pk;
                pst.setString(1, idItemFamily);
                pst.setString(2, lastUpdate);
                pst.execute();
                return true;

            case 46: // '.'
                pst = con.prepareStatement("DELETE FROM familles_clients WHERE id=? AND update_time=?");
                String idCustomerFamily = (String)pk;
                pst.setString(1, idCustomerFamily);
                pst.setString(2, lastUpdate);
                pst.execute();
                return true;

            case 10: // '\n'
                pst = con.prepareStatement("DELETE FROM familles_fournisseurs WHERE id=? AND update_time=?");
                String idSupplierFamily = (String)pk;
                pst.setString(1, idSupplierFamily);
                pst.setString(2, lastUpdate);
                pst.execute();
                return true;

            case 39: // '\''
                pst = con.prepareStatement("DELETE FROM sales_person_family WHERE id=? AND update_time=?");
                String idSalesPersonFamily = (String)pk;
                pst.setString(1, idSalesPersonFamily);
                pst.setString(2, lastUpdate);
                pst.execute();
                return true;

            case 40: // '('
                pst = con.prepareStatement("DELETE FROM detail_list WHERE id=? AND update_time=?");
                pst.setInt(1, ((Integer)pk).intValue());
                pst.setString(2, lastUpdate);
                pst.execute();
                return true;

            case 41: // ')'
                pst = con.prepareStatement("DELETE FROM detail_articles WHERE id=? AND update_time=?");
                pst.setInt(1, ((Integer)pk).intValue());
                pst.setString(2, lastUpdate);
                pst.execute();
                return true;

            case 42: // '*'
                pst = con.prepareStatement("DELETE FROM detail_clients WHERE id=? AND update_time=?");
                pst.setInt(1, ((Integer)pk).intValue());
                pst.setString(2, lastUpdate);
                pst.execute();
                return true;

            case 44: // ','
                pst = con.prepareStatement("DELETE FROM detail_commerciaux WHERE id=? AND update_time=?");
                pst.setInt(1, ((Integer)pk).intValue());
                pst.setString(2, lastUpdate);
                pst.execute();
                return true;

            case 45: // '-'
                pst = con.prepareStatement("DELETE FROM detail_entreprise WHERE id=? AND update_time=?");
                pst.setInt(1, ((Integer)pk).intValue());
                pst.setString(2, lastUpdate);
                pst.execute();
                return true;

            case 43: // '+'
                pst = con.prepareStatement("DELETE FROM detail_fournisseurs WHERE id=? AND update_time=?");
                pst.setInt(1, ((Integer)pk).intValue());
                pst.setString(2, lastUpdate);
                pst.execute();
                return true;

            case 47: // '/'
                pst = con.prepareStatement("DELETE FROM detail_utilisateurs WHERE id=? AND update_time=?");
                pst.setInt(1, ((Integer)pk).intValue());
                pst.setString(2, lastUpdate);
                pst.execute();
                return true;

            case 19: // '\023'
                pst = con.prepareStatement("DELETE FROM utilisateurs WHERE id=? AND update_time=?");
                pst.setString(1, (String)pk);
                pst.setString(2, lastUpdate);
                pst.execute();
                return true;

            case 48: // '0'
                pst = con.prepareStatement("DELETE FROM remise_par_client WHERE id=? AND update_time=?");
                pst.setInt(1, ((Integer)pk).intValue());
                pst.setString(2, lastUpdate);
                pst.execute();
                return true;

            case 49: // '1'
                pst = con.prepareStatement("DELETE FROM remise_famart_par_client WHERE id=? AND update_time=?");
                pst.setInt(1, ((Integer)pk).intValue());
                pst.setString(2, lastUpdate);
                pst.execute();
                return true;

            case 16: // '\020'
                pst = con.prepareStatement("DELETE FROM comm_par_article WHERE id=? AND update_time=?");
                pst.setInt(1, ((Integer)pk).intValue());
                pst.setString(2, lastUpdate);
                pst.execute();
                return true;

            case 50: // '2'
                pst = con.prepareStatement("DELETE FROM comm_par_famille WHERE id=? AND update_time=?");
                pst.setInt(1, ((Integer)pk).intValue());
                pst.setString(2, lastUpdate);
                pst.execute();
                return true;

            case 51: // '3'
                pst = con.prepareStatement("DELETE FROM db WHERE id=? AND update_time=?");
                pst.setInt(1, ((Integer)pk).intValue());
                pst.setString(2, lastUpdate);
                pst.execute();
                return true;

            case 13: // '\r'
            case 14: // '\016'
            case 17: // '\021'
            case 23: // '\027'
            case 29: // '\035'
            default:
                return false;
            }
        }
        catch(SQLException e)
        {
            e.printStackTrace();
        }
        return false;
    }

    private boolean cascadeDelete(Object pk, int type)
    {
        try
        {
            switch(type)
            {
            case 22: // '\026'
                pst = con.prepareStatement("DELETE FROM contenu WHERE vente_id=?");
                pst.setString(1, (String)pk);
                pst.execute();
                return true;

            case 25: // '\031'
                pst = con.prepareStatement("DELETE FROM contenu WHERE facture_id=?");
                pst.setString(1, (String)pk);
                pst.execute();
                return true;

            case 24: // '\030'
                pst = con.prepareStatement("DELETE FROM contenu_a WHERE vente_id=?");
                pst.setString(1, (String)pk);
                pst.execute();
                return true;

            case 27: // '\033'
                pst = con.prepareStatement("DELETE FROM remise_par_client WHERE clients_id=?");
                pst.setString(1, (String)pk);
                pst.execute();
                pst = con.prepareStatement("DELETE FROM remise_famart_par_client WHERE clients_id=?");
                pst.setString(1, (String)pk);
                pst.execute();
                pst = con.prepareStatement("SELECT id,update_time FROM ventes WHERE clients_id=?");
                pst.setString(1, (String)pk);
                rs = pst.executeQuery();
                if(rs.next())
                    deleteSQL(rs.getString(1), rs.getString(2), 22);
                return true;

            case 9: // '\t'
                pst = con.prepareStatement("");
                pst.setString(1, (String)pk);
                pst.execute();
                return true;

            case 11: // '\013'
                pst = con.prepareStatement("");
                pst.setString(1, (String)pk);
                pst.execute();
                return true;

            case 26: // '\032'
                pst = con.prepareStatement("");
                Integer idPayment = (Integer)pk;
                pst.setInt(1, idPayment.intValue());
                pst.execute();
                return true;

            case 20: // '\024'
                pst = con.prepareStatement("");
                Integer idReminder = (Integer)pk;
                pst.setInt(1, idReminder.intValue());
                pst.execute();
                return true;

            case 15: // '\017'
                pst = con.prepareStatement("");
                Integer idSalesPerson = (Integer)pk;
                pst.setInt(1, idSalesPerson.intValue());
                pst.execute();
                return true;

            case 21: // '\025'
                pst = con.prepareStatement("");
                Integer idAgency = (Integer)pk;
                pst.setInt(1, idAgency.intValue());
                pst.execute();
                return true;

            case 28: // '\034'
                pst = con.prepareStatement("");
                Integer idSalesRow = (Integer)pk;
                pst.setInt(1, idSalesRow.intValue());
                pst.execute();
                return true;

            case 30: // '\036'
                pst = con.prepareStatement("");
                Integer idBuysRow = (Integer)pk;
                pst.setInt(1, idBuysRow.intValue());
                pst.execute();
                return true;

            case 18: // '\022'
                pst = con.prepareStatement("");
                Integer idTax = (Integer)pk;
                pst.setInt(1, idTax.intValue());
                pst.execute();
                return true;

            case 10: // '\n'
            case 12: // '\f'
            case 13: // '\r'
            case 14: // '\016'
            case 16: // '\020'
            case 17: // '\021'
            case 19: // '\023'
            case 23: // '\027'
            case 29: // '\035'
            default:
                return false;
            }
        }
        catch(SQLException e)
        {
            e.printStackTrace();
        }
        return false;
    }

    private boolean cascadeDeleteLevel2(Object pk, int type)
    {
        try
        {
            switch(type)
            {
            case 22: // '\026'
                pst = con.prepareStatement("");
                pst.setString(1, (String)pk);
                pst.execute();
                return true;

            case 25: // '\031'
                pst = con.prepareStatement("");
                pst.setString(1, (String)pk);
                pst.execute();
                return true;

            case 24: // '\030'
                pst = con.prepareStatement("");
                pst.setString(1, (String)pk);
                pst.execute();
                return true;

            case 27: // '\033'
                pst = con.prepareStatement("");
                pst.setString(1, (String)pk);
                pst.execute();
                return true;

            case 9: // '\t'
                pst = con.prepareStatement("");
                pst.setString(1, (String)pk);
                pst.execute();
                return true;

            case 11: // '\013'
                pst = con.prepareStatement("");
                pst.setString(1, (String)pk);
                pst.execute();
                return true;

            case 26: // '\032'
                pst = con.prepareStatement("");
                Integer idPayment = (Integer)pk;
                pst.setInt(1, idPayment.intValue());
                pst.execute();
                return true;

            case 20: // '\024'
                pst = con.prepareStatement("");
                Integer idReminder = (Integer)pk;
                pst.setInt(1, idReminder.intValue());
                pst.execute();
                return true;

            case 15: // '\017'
                pst = con.prepareStatement("");
                Integer idSalesPerson = (Integer)pk;
                pst.setInt(1, idSalesPerson.intValue());
                pst.execute();
                return true;

            case 21: // '\025'
                pst = con.prepareStatement("");
                Integer idAgency = (Integer)pk;
                pst.setInt(1, idAgency.intValue());
                pst.execute();
                return true;

            case 28: // '\034'
                pst = con.prepareStatement("");
                Integer idSalesRow = (Integer)pk;
                pst.setInt(1, idSalesRow.intValue());
                pst.execute();
                return true;

            case 30: // '\036'
                pst = con.prepareStatement("");
                Integer idBuysRow = (Integer)pk;
                pst.setInt(1, idBuysRow.intValue());
                pst.execute();
                return true;

            case 18: // '\022'
                pst = con.prepareStatement("");
                Integer idTax = (Integer)pk;
                pst.setInt(1, idTax.intValue());
                pst.execute();
                return true;

            case 10: // '\n'
            case 12: // '\f'
            case 13: // '\r'
            case 14: // '\016'
            case 16: // '\020'
            case 17: // '\021'
            case 19: // '\023'
            case 23: // '\027'
            case 29: // '\035'
            default:
                return false;
            }
        }
        catch(SQLException e)
        {
            e.printStackTrace();
        }
        return false;
    }

    private Integer getNewId(String request)
    {
        try
        {
            SQLList list = new SQLList();
            if(list.search(request))
            {
                Vector rows = list.getRows();
                if((String)rows.firstElement() == null)
                    return new Integer(1);
                else
                    return new Integer((String)rows.firstElement());
            } else
            {
                return null;
            }
        }
        catch(Exception e)
        {
            e.printStackTrace();
        }
        return null;
    }

    private PreparedStatement pst;
    private ResultSet rs;
    private Connection con;
    private MEDate date;
}
